Avoid serializing exceptions as JSON in OTLP endpoint#144045
Merged
felixbarny merged 4 commits intoelastic:mainfrom Mar 19, 2026
Merged
Avoid serializing exceptions as JSON in OTLP endpoint#144045felixbarny merged 4 commits intoelastic:mainfrom
felixbarny merged 4 commits intoelastic:mainfrom
Conversation
Made-with: Cursor
78a9e5a to
19c7c89
Compare
…lure responses Guard against null exception messages in sendFailureResponse, and add a comment explaining that Status.code is intentionally omitted per the OTLP spec, which states the server MAY omit it and clients must not alter behavior based on it.
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
sidosera
approved these changes
Mar 18, 2026
...in/otel-data/src/main/java/org/elasticsearch/xpack/oteldata/otlp/AbstractOTLPRestAction.java
Show resolved
Hide resolved
Co-authored-by: Sergey Sidorov <SERGEY.IVANOVICH.SIDOROV@gmail.com>
michalborek
pushed a commit
to michalborek/elasticsearch
that referenced
this pull request
Mar 23, 2026
Co-authored-by: Sergey Sidorov <SERGEY.IVANOVICH.SIDOROV@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid using a
RestResponseListenerinAbstractOTLPRestActionso that the response is never rendered as JSON, even for exceptions that get thrown before the transport action is invoked.The transport action now uses the
onFailurecallback instead ofonResponsefor error cases, which simplifies the handling and makes it more idiomatic. Error cases (all data points ignored, 429 throttling, processing exceptions) go throughonFailure, while success and partial success (HTTP 200 per the OTLP spec) continue to useonResponse.Failure responses now use a Protobuf-encoded
google.rpc.Statusmessage as required by the OTLP spec:Previously, we were using a
ExportMetricsPartialSuccessmessage which is not spec compliant.This mirrors the changes made for Prometheus in #143987.
Depends on #144009.