-
Notifications
You must be signed in to change notification settings - Fork 2.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
[connector/otlpjson]: Do not emit empty batches #35827
Conversation
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.
Thank you Khushi!
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.
Apologies for not commenting sooner, but this implementation highlighted the actual problem for me. Please see #35738 (comment)
err = c.tracesConsumer.ConsumeTraces(ctx, t) | ||
if err != nil { | ||
c.logger.Error("could not consume traces from otlp json", zap.Error(err)) | ||
if t.ResourceSpans().Len() != 0 { |
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.
Should we call t.SpanCount()
instead? https://github.com/open-telemetry/opentelemetry-collector/blob/main/pdata/ptrace/traces.go#L44
Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Please fix lint errors |
93e2bac
to
7946e54
Compare
f10429e
to
411c6fb
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.
Thank's @khushijain21!
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description The connector now does not emit empty batches for invalid otlp payload and throws an error instead. Approach discussed here open-telemetry#35738 (comment) <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#35738 and open-telemetry#35739 <!--Describe what testing was performed and which tests were added.--> #### Testing Manual Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description The connector now does not emit empty batches for invalid otlp payload and throws an error instead. Approach discussed here open-telemetry#35738 (comment) <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#35738 and open-telemetry#35739 <!--Describe what testing was performed and which tests were added.--> #### Testing Manual Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Daniel Jaglowski <jaglows3@gmail.com>
Description
The connector now does not emit empty batches for invalid otlp payload and throws an error instead. Approach discussed here #35738 (comment)
Link to tracking issue
Fixes #35738 and #35739
Testing
Manual Testing
Documentation