-
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
[exporter/otlphttp] added support for configurable telemetry encoding #9276
[exporter/otlphttp] added support for configurable telemetry encoding #9276
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #9276 +/- ##
==========================================
- Coverage 90.45% 90.34% -0.11%
==========================================
Files 346 346
Lines 18131 18194 +63
==========================================
+ Hits 16400 16437 +37
- Misses 1399 1424 +25
- Partials 332 333 +1 ☔ View full report in Codecov by Sentry. |
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.
Thanks @tvaintrob please also add a changelog
What is the use-case for this? I remember that we intentionally did not want to offer this, because it is just a slower version of the proto and you don't have the dependency issue like you have on the client side (web) to avoid depending on protobuf. |
@bogdandrutu in my case we have a WAF that we want to send messages through but it needs to do a deep validation of the messages being passed, unfortunately it doesn't support reading binary data so we need to send the messages using JSON |
@songy23 fixed all comments except for the additional tests |
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.
Please fix the failed tests https://github.com/open-telemetry/opentelemetry-collector/actions/runs/7513270300/job/20574065081?pr=9276
We can mention in the documentation that json should only be used in endpoints that can only accept json, but discouraged in other use cases, e.g. collector-to-collector case. Does that sound good? @bogdandrutu |
I agree with supporting |
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.
LGTM
cc @open-telemetry/collector-approvers PTAL
@bogdandrutu There was general agreement on last week's Collector SIG to add support for this. Do you think we should add something in the README about the performance implications? |
@TylerHelmuth updated the PR with the requested changes, not all are possible due to the issues with contrib Thanks |
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.
Thanks for opening open-telemetry/opentelemetry-collector-contrib#30703. I'd say we fix that before merging this PR.
Turns out to be straightforward to fix it, I have open-telemetry/opentelemetry-collector-contrib#30759 |
Dismiss the approval now that blocker is removed factory.CreateDefaultConfig() needs updating
Thanks for the update @songy23 ill update this one to include the default encoding |
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.
Minor comments, LGTM otherwise
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.
@tvaintrob please add some test cases that hit the new error scenarios and a test for the new UnmarshalText function.
Co-authored-by: Yang Song <songy23@users.noreply.github.com>
@TylerHelmuth @songy23 updated the PR, i rather take care of the extra error cases in a different PR, feels out of scope for this one I'll open a ticket for it once this one is merged |
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.
LGTM, please file an issue to return error on invalid content-type in requests.
#9413 created an issue for that, thanks |
@TylerHelmuth just waiting on your approval to merge this one Thanks! |
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.
@tvaintrob could you add a could more test scenarios to cover the error cases Codecov
is complaining about?
I had a talk with @songy23 about it, he said that it's ok to leave it like that, do you have any example on how to generate malformed data? |
I think you'd have to call the private functions directly. I am ok moving forward without these tests since they cover such unlikely, simple scenarios |
@bogdandrutu I will merge this on or after Wednesday next week EU morning. Please block by then if you think we should not merge this. |
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.
LGTM
@tvaintrob please fix the merge conflict and I can merge afterwards :) |
@mx-psi Hi, resolved the merge conflict, thanks! |
Description:
This PR adds support for encoding configuration in the
otlphttp
exporter.Link to tracking Issue:
#6945
Testing:
Updated existing tests, and added relevant tests
Documentation:
Updated the
otlphttp
docs to include the new configuration option.