Skip to content

feat(supervisor): accept OTLP/HTTP JSON in the agent trace relay - #5466

Open
ericcurtin wants to merge 2 commits into
NVIDIA:mainfrom
ericcurtin:feat/5319-otlp-relay-json/ericcurtin
Open

ericcurtin wants to merge 2 commits into
NVIDIA:mainfrom
ericcurtin:feat/5319-otlp-relay-json/ericcurtin

Conversation

@ericcurtin

@ericcurtin ericcurtin commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The agent trace relay now accepts OTLP/HTTP JSON as well as protobuf.

Related Issue

Closes #5319

Changes

  • Transcode JSON to protobuf, then reuse the existing enrichment and limits
  • Answer in the request's content type, {} on success
  • Cap JSON bodies at 32 levels and 100,000 values to bound decode memory
  • Enable with-serde on opentelemetry-proto for the supervisor only
  • Update the relay docs

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added/updated (if applicable)
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Transcode JSON to protobuf before enrichment.

Signed-off-by: Eric Curtin <eric.curtin@docker.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ericcurtin

Copy link
Copy Markdown
Contributor Author

recheck

@ericcurtin

Copy link
Copy Markdown
Contributor Author

@rhuss @krishicks PTAL when you get a chance. Could you add an area label and /ok to test 1e86d87de483ee46270fd12087849f7647209f20 if it looks good? Thank you!

@rhuss rhuss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc-review Summary

What Went Well

  • Encoding::of (lines 455-465) parses the media type once, and the same value picks the decoder and the response encoding.
  • JSON is transcoded to protobuf and then goes through the same enrichment::enrich call inside the existing enrichment semaphore, so attribution has one implementation and MAX_ENRICHED_BYTES still applies.
  • reply reaches every rejection, so 404, 408, 413, 415 and 503 (with Retry-After) all answer in the request's content type.
  • json_request_is_transcoded_enriched_and_answered_in_json checks the exact hex-decoded trace and span ID bytes and both attribution attributes, and other_content_types_are_unsupported was updated rather than deleted.

Findings

Severity File Description Source
Minor Cargo.toml:73 with-serde is turned on in the workspace-wide opentelemetry-proto entry, but only openshell... architecture
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:198 success(encoding.unwrap_or(Encoding::Protobuf)) repeats the fallback that line 187 already sto... architecture
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:284 The JSON transcode (serde_json::from_slice plus encode_to_vec) runs inline in the async hand... production
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:478 The JSON path decodes the whole request, but the crate docs still describe a protobuf-only relay... architecture
Critical crates/openshell-supervisor/src/otlp_relay/receiver.rs:483 The { count doesn't bound what serde_json::from_slice allocates. In opentelemetry-proto 0.... security
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:483 body.split(|byte| *byte == b'{').count() returns the number of braces plus one, so a body with... architecture
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:484 The JSON cap returns EnrichError::TooManyResourceSpans, whose message is "more than 512 resour... architecture
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:486 Some valid OTLP/JSON gets a 400. {"arrayValue":{}} and {"kvlistValue":{}} (an empty list wit... correctness
Notable crates/openshell-supervisor/src/otlp_relay/receiver.rs:486 Issue #5319 lists "Claude Code with detailed beta tracing, pointed at the relay endpoint, produc... goal-alignment
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:488 The 400 body carries error.to_string() from serde_json, which includes the whole offending str... security
Notable crates/openshell-supervisor/src/otlp_relay/receiver.rs:513 rejected() still logs 400, 413 and 415 responses only at debug level, and RelayCounters coun... production
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:838 json_body() sends "kind":1 and string-encoded startTimeUnixNano/endTimeUnixNano, but js... test-quality
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:888 json_body_of_tiny_objects_is_too_large_and_never_buffered checks the status, the content type... test-quality
Minor crates/openshell-supervisor/src/otlp_relay/receiver.rs:899 metrics_and_logs_json_are_acknowledged_with_an_empty_object posts only to /v1/logs and, unli... test-quality

Review Details

These findings were produced by cc-review's reviewer agents and posted without a per-finding review. Most failure scenarios were derived from reading the code; the measured figures (memory, timings, error sizes) come from small probe programs that the reviewer agents built and ran against this PR's transcode_json and locked dependency versions, not from running the relay itself.

  • Findings posted: 14
  • Findings reviewed and not posted: 0
  • Gate outcome: FAIL
  • Participating reviewers: architecture, correctness, goal-alignment, production, security, test-quality, gator

Comment thread Cargo.toml Resolved
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
@ericcurtin

Copy link
Copy Markdown
Contributor Author

@rhuss @TaylorMutch All threads addressed in 11422cd. PTAL when you get a chance. It needs an area label and /ok to test 11422cd5c5eae1a06e34fa0b9db611c767420c17. Thank you!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(supervisor): accept OTLP/HTTP JSON in the agent trace relay

2 participants