-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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] Invalid OTLP payload is silently ignored #35739
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Doesn't this fall into the same category with what the #35738 describes? A ptrace given as an input to metrics' unmarshaller is an "invalid" otlp similar to what a very random JSON would be 🤔 . |
<!--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>
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
<!--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>
Component(s)
connector/otlpjson
What happened?
Description
The OTLP/JSON connector reports errors on invalid JSON, but silently ignores valid JSON that is not valid OTLP. I would expect it to also error out on valid JSON that is not valid OTLP. As another enhancement, an
error_mode
option could be added for users to configure the behavior.Steps to Reproduce
Prepare a newline-delimited JSON file like the below non-otlp.json file:
Run the collector with the below configuration, reading the file with Filelog receiver and passing it to OTLP/JSON connector and to Debug exporter.
Expected Result
The OTLP/JSON connector rejects the input lines, outputting an error message saying that the input is not valid OTLP.
Actual Result
The connector does not report any errors. It emits an empty batch for each invalid OTLP line (see related issue #35738).
Collector version
v0.111.0
Environment information
Environment
OS: Ubuntu 24.04
OpenTelemetry Collector configuration
Log output
Additional context
The
Unmarshal(Logs|Metrics|Traces)
methods do not return an error for valid JSON that is not a valid OTLP payload. They just return an empty object of logs/metrics/traces data. See https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.111.0/connector/otlpjsonconnector/traces.go#L55 for example.The text was updated successfully, but these errors were encountered: