-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for additional decoders #7977
add support for additional decoders #7977
Conversation
1f1bfc5
to
2aece6b
Compare
2aece6b
to
57dd104
Compare
57dd104
to
5139a96
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #7977 +/- ##
==========================================
+ Coverage 90.90% 90.96% +0.05%
==========================================
Files 300 300
Lines 15074 15090 +16
==========================================
+ Hits 13703 13726 +23
+ Misses 1097 1091 -6
+ Partials 274 273 -1
☔ View full report in Codecov by Sentry. |
I think reverting to the wrong behavior is probably not what we want. Let's go forward with your PR. The question I have is whether there is a need for custom decoders or we just need to add "snappy" for all? |
Adding snappy would address the one case failing in contrib at the moment. I've not looked for additional cases, though @jpkrohling pointed out in a DM that this would allow anyone wanting to offer alternative decoders even for supported encodings could do so w/ this functionality |
b6bd232
to
01ec534
Compare
This provides the ability to add support for compression types which are not supported in core, to be supported by individual components. Signed-off-by: Alex Boten <aboten@lightstep.com>
01ec534
to
abf444a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but I would love to have another test for snappy.
}, | ||
}, | ||
} | ||
d.decoders["deflate"] = d.decoders["zlib"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be asking too much to add an explicit test for snappy, as this is the one failing for existing receivers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could add one, but it would essentially be a duplicate of the "UnsupportedCompression" test here:
opentelemetry-collector/config/confighttp/compression_test.go
Lines 185 to 189 in ec033ca
name: "UnsupportedCompression", | |
encoding: "nosuchcompression", | |
reqBody: bytes.NewBuffer(testBody), | |
respCode: http.StatusBadRequest, | |
respBody: "unsupported Content-Encoding: nosuchcompression\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea is that it would replace the "custom-encoding" test case with a real implementation, and it would be converted into a test that overrides an existing encoding once snappy is added. In any case, this isn't a blocker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add this in a follow up PR since this is blocking contrib :)
This provides the ability to add support for compression types which are not supported in core, to be supported by individual components.
This change addresses an issue caused by #7927, which prevents receivers that use confighttp from adding support for their content-encoding types easily. They still can by implementing an error handler, but that seems messy.
An alternative to this PR is to not return an error for an unsupported encoding type as was the case before #7927
If the approach is acceptable, I will add the unit tests and changelog