Skip to content

feat(observability): report OTLP/HTTP partial success as runtime diagnostics - #1614

Merged
willkill07 merged 3 commits into
NVIDIA:mainfrom
Somay-kousis:feat/otlp-partial-success
Nov 3, 2026
Merged

willkill07 merged 3 commits into
NVIDIA:mainfrom
Somay-kousis:feat/otlp-partial-success

Conversation

@Somay-kousis

@Somay-kousis Somay-kousis commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Overview

A collector can return 200 with partial_success and drop some spans, log records or metric data points. The vendored exporter only logs that internally, so runtime_diagnostics() stayed empty and force_flush() looked clean. This records it.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • otel_signal.rs: OtlpSignal, record_otlp_partial_success, and PartialSuccessHttpClient. On a 2xx it decodes ExportTrace/Logs/MetricsServiceResponse (protobuf, or JSON by the request's Content-Type; JSON counts can be numbers or decimal strings) and records otel.partial_success (as agreed on [Enhancement]: Report OTLP partial success as a runtime diagnostic #1597) with the rejected count in that signal's diagnostics. The message has the endpoint origin only; the collector's error_message is left out, same reasoning as the TLS path.
  • Traces: DiagnosticTraceHttpClient calls it after the existing TLS handling, which is unchanged.
  • Logs and metrics: every HTTP exporter (manual, header-file and automatic) is wrapped; build_*_exporter now take the signal's SignalRuntimeDiagnostics.
  • The warn log fires when the rejected total crosses a power of two, so steady small rejections still log, and stays quiet when the diagnostics table is full.
  • Export results don't change: force_flush() and shutdown() still succeed. Zero or negative counts, non-2xx responses and unreadable bodies record nothing.
  • gRPC isn't covered (it doesn't go through HttpClient); the docs warning now says only that.

Where should the reviewer start?

crates/observability/src/otel_signal.rs (rejected_count and record_otlp_partial_success), then the three e2e tests that run a local collector returning partial_success.

Testing

  • New unit tests tests/unit/otel_partial_success_tests.rs: protobuf and JSON, all three signals, string-encoded counts, accumulation, zero/negative/malformed, non-2xx, full diagnostics table, and the endpoint origin without credentials or query.
  • New e2e tests in otel_detached_tests.rs, otel_logs_detached_tests.rs, otel_metrics_detached_tests.rs: a local HTTP collector answers with partial_success, and the subscriber's runtime_diagnostics() has the code with the right count.
  • Checked the e2e tests fail when the wrapper is removed or tagged with the wrong signal.
  • cargo test -p nemo-relay-observability (616 pass), cargo clippy --all-targets -D warnings, uv run pre-commit run (all hooks pass).
  • just test-rust: all pass except two nemo-relay-cli doctor tests (collect_configuration_uses_xdg_global_path_and_renders_resolution_branches, configuration_and_path_helpers_cover_direct_paths_and_fallbacks), which fail the same way on unmodified main on my machine because of a local ~/.config/nemo-relay.

Not covered by a test: the automatic (env-configured) HTTP paths assert wiring only by construction. The 0.11 release notes still list this limitation; I left that page alone.

Related Issues

Summary by CodeRabbit

  • New Features
    • OTLP/HTTP exports now report collector-rejected spans, log records, and metric points in runtime diagnostics. Reports include the endpoint origin but exclude collector error messages. Partial rejection does not cause an otherwise successful export to fail.
    • Rejection counts accumulate across exports, with warnings logged when the total first becomes nonzero and each time it reaches a power of two.
  • Documentation
    • Clarified that partial rejections are reported for OTLP/HTTP, while OTLP/gRPC partial rejections remain unreported and are treated as successful.

@Somay-kousis
Somay-kousis requested review from a team as code owners November 3, 2026 14:15
@copy-pr-bot

copy-pr-bot Bot commented Nov 3, 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.

@github-actions github-actions Bot added size:L PR is large Feature a new feature lang:rust PR changes/introduces Rust code labels Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

OTLP/HTTP responses with positive partial-success rejection counts now produce signal-specific runtime diagnostics for traces, logs, and metrics. Exporters return the original response, and exports remain successful. Tests cover JSON and protobuf responses. Documentation states that gRPC partial-success responses remain unreported.

Changes

OTLP partial-success reporting

Layer / File(s) Summary
Parse responses and record diagnostics
crates/observability/Cargo.toml, crates/observability/src/otel.rs, crates/observability/src/otel_signal.rs
The observability crate enables the OTLP metrics feature. The HTTP client parses JSON or protobuf rejection counts for each signal. Positive counts produce runtime diagnostics. The client returns the original response.
Wire exporters and validate signal diagnostics
crates/observability/src/otel_logs.rs, crates/observability/src/otel_metrics.rs, crates/observability/tests/unit/otel_partial_success_tests.rs, crates/observability/tests/unit/otel_detached_tests.rs, crates/observability/tests/unit/otel_logs_detached_tests.rs, crates/observability/tests/unit/otel_metrics_detached_tests.rs, docs/configure-plugins/observability/opentelemetry.mdx
Log and metric HTTP exporters pass runtime diagnostics to the response wrapper. Unit and collector tests cover all three signals, response handling, and exclusion of collector error text. The documentation distinguishes HTTP diagnostics from unreported gRPC partial success.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant OTLPExporter
  participant PartialSuccessHttpClient
  participant OTLPCollector
  participant SignalRuntimeDiagnostics
  OTLPExporter->>PartialSuccessHttpClient: Send export request
  PartialSuccessHttpClient->>OTLPCollector: Send HTTP request
  OTLPCollector-->>PartialSuccessHttpClient: Return successful OTLP response
  PartialSuccessHttpClient->>SignalRuntimeDiagnostics: Record positive rejected-item count
  PartialSuccessHttpClient-->>OTLPExporter: Return original response
Loading
Merge Risk: Minimal · up to 1a42d

HTTP partial successes are reported without changing export results. No merge-blocking risk was established.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

Failed Failed checks: 1 error · 1 warning

Check name Status Explanation Resolution
Title check Error The title follows Conventional Commits: type feat with scope observability, lowercase, imperative summary, no trailing period. It is 76 characters, which exceeds the 72-character limit. The title … Shorten the title to 72 characters or fewer. For example: "feat(observability): record OTLP/HTTP partial success as diagnostics". Keep the type, scope, and imperative form.
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Description check Passed The description follows the repository template. It has Overview with both checklist items marked, Details, Where should the reviewer start, and Related Issues with "Closes #1597". It also adds a Test…
Linked Issues check Passed Issue #1597 is the only active directly linked issue. The change adds otel.partial_success diagnostics for positive rejected spans, log records, and metric data points from OTLP/HTTP protobuf and JS…
Out of Scope Changes check Passed The dependency feature update, shared response parsing, HTTP-client wrappers, trace/log/metric wiring, documentation, and tests directly support issue #1597. The warning threshold supports the new run…
Full details: Description check

Explanation

The description follows the repository template. It has Overview with both checklist items marked, Details, Where should the reviewer start, and Related Issues with "Closes #1597". It also adds a Testing section. The content matches the changes in the raw summary and the linked objectives: partial-success handling for HTTP trace, log, and metric exporters, the diagnostic behavior, gRPC exclusion, and the test coverage.

Full details: Linked Issues check

Explanation

Issue #1597 is the only active directly linked issue. The change adds otel.partial_success diagnostics for positive rejected spans, log records, and metric data points from OTLP/HTTP protobuf and JSON responses. It records no diagnostic for missing, zero, negative, malformed, unreadable, or non-2xx responses. Diagnostic text excludes the collector error_message and sensitive URI parts. The HTTP wrapper preserves export results, so force_flush() and shutdown() remain successful. Tests cover all three signals, response formats, accumulation, and key negative cases. The documentation now distinguishes HTTP handling from the gRPC limitation.

Full details: Out of Scope Changes check

Explanation

The dependency feature update, shared response parsing, HTTP-client wrappers, trace/log/metric wiring, documentation, and tests directly support issue #1597. The warning threshold supports the new runtime diagnostic. No changed area is shown to be unrelated to the linked issue.

Full details: Title check

Explanation

The title follows Conventional Commits: type feat with scope observability, lowercase, imperative summary, no trailing period. It is 76 characters, which exceeds the 72-character limit. The title otherwise matches the main change: recording OTLP/HTTP partial success as runtime diagnostics.

Resolution

Shorten the title to 72 characters or fewer. For example: "feat(observability): record OTLP/HTTP partial success as diagnostics". Keep the type, scope, and imperative form.

Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 18 functions across 8 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between b8e7149 and 1a42d6a.

Files selected for processing: 3
  • crates/observability/src/otel.rs
  • crates/observability/tests/unit/otel_detached_tests.rs
  • docs/configure-plugins/observability/opentelemetry.mdx

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Recent review details
Context from checks skipped due to timeout: 1
  • GitHub Check: CodeRabbit
Additional context used
Code guidelines: 4
.agents/skills/contribute-docs/SKILL.md — configured
.agents/skills/maintain-observability/SKILL.md — configured
AGENTS.md — configured
.agents/skills/review-doc-style/SKILL.md — configured
Path-based instructions: 6
Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.

CodeRabbit configuration file

Files:

  • docs/configure-plugins/observability/opentelemetry.mdx
Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.

CodeRabbit configuration file

Files:

  • crates/observability/tests/unit/otel_detached_tests.rs
Source excerpt: In MDX files, top-of-file comments must use JSX comment delimiters: `{/*` to open and `*/}` to close.

CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Files:

  • docs/configure-plugins/observability/opentelemetry.mdx
Source excerpt: Core event model and emitted fields `crates/core/src/observability/atif.rs` `crates/core/src/observability/otel.rs` `crates/core/src/observability/openinference.rs` FFI and binding-native wrappers where the config or lifecyc...

CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)

Files:

  • docs/configure-plugins/observability/opentelemetry.mdx
Source excerpt: Update public documentation and examples when public behavior, package names, supported bindings, or documented workflows change.

CodeRabbit inference engine (AGENTS.md)

Files:

  • docs/configure-plugins/observability/opentelemetry.mdx
Source excerpt: Verify MDX files use JSX delimiters for top-of-file SPDX comments.

CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Files:

  • docs/configure-plugins/observability/opentelemetry.mdx
Learnings: 1
Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: .agents/skills/maintain-observability/SKILL.md:0-0
Timestamp: 2026-11-01T01:48:07.482Z
Learning: Source excerpt:
# Maintain Observability Surfaces

## Validation

- Update and validate docs or examples when the public workflow, documented
  observability contract, or emitted output changed.
Additional comments: 3
crates/observability/src/otel.rs: 1

1722-1724: LGTM!

Also applies to: 1746-1758

crates/observability/tests/unit/otel_detached_tests.rs: 1

1996-2064: LGTM!

docs/configure-plugins/observability/opentelemetry.mdx: 1

780-789: LGTM!

Also applies to: 791-794

@coderabbitai coderabbitai Bot 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.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread crates/observability/src/otel_signal.rs Resolved
Comment thread crates/observability/src/otel_signal.rs Resolved
@willkill07 willkill07 self-assigned this Nov 3, 2026
@willkill07 willkill07 added this to the 1.0 milestone Nov 3, 2026

@coderabbitai coderabbitai Bot 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.

  • Fix comments: Fix CodeRabbit comments on this PR

@willkill07

Copy link
Copy Markdown
Member

/ok to test b8e7149

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

License Diff

Compared against origin/main.

Lockfile license changes

Lockfile License Changes

Rust

Added

  • None

Removed

  • None

Updated/Changed

  • None

Node

Added

  • None

Removed

  • None

Updated/Changed

  • None

Python

Added

  • None

Removed

  • None

Updated/Changed

  • None
Status output
[license-diff] selected languages: rust, node, python
[license-diff] generating current inventory
[license-diff] current: generating Rust inventory
[license-diff] current: Rust inventory complete (489 packages)
[license-diff] current: generating Node inventory
[license-diff] current: Node inventory complete (407 packages)
[license-diff] current: generating Python inventory
[license-diff] current: Python inventory complete (158 packages)
[license-diff] current inventory complete
[license-diff] checking out base ref origin/main into a temporary worktree
[license-diff] base: generating Rust inventory
[license-diff] base: Rust inventory complete (489 packages)
[license-diff] base: generating Node inventory
[license-diff] base: Node inventory complete (407 packages)
[license-diff] base: generating Python inventory
[license-diff] base: Python inventory complete (158 packages)
[license-diff] base inventory complete
[license-diff] removing temporary base worktree
[license-diff] comparing inventories
[license-diff] rendering Markdown output
[license-diff] done

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

@willkill07

Copy link
Copy Markdown
Member

@Somay-kousis could you resolve a test merge conflict?

…nostics

A collector can answer an OTLP/HTTP export with 200 and partial_success,
rejecting some items. The SDK only logs it, so runtime_diagnostics() and
force_flush() looked clean. Decode the response for traces, logs and metrics
(protobuf and JSON) and record otel.spans_rejected, otel.logs_rejected or
otel.metric_points_rejected with the rejected count. gRPC stays a documented
limitation.

Closes NVIDIA#1597

Signed-off-by: Somay-kousis <[email protected]>
…n nothing was recorded

Match the diagnostic code agreed on NVIDIA#1597; each signal owns its recorder, so one code does not mix counts. When the diagnostics table is full, record returns 0, which previously logged a warning on every rejected response.

Signed-off-by: Somay-kousis <[email protected]>
With one otel.partial_success code, the wrapper's signal only shows in the message, and all three responses keep the rejected count in protobuf field 1. Assert the item type so a wrapper wired to the wrong signal fails.

Signed-off-by: Somay-kousis <[email protected]>
@Somay-kousis
Somay-kousis force-pushed the feat/otlp-partial-success branch from b8e7149 to 1a42d6a Compare November 3, 2026 19:32
@Somay-kousis

Copy link
Copy Markdown
Contributor Author

Rebased on main (1a42d6a). The conflict was both PRs appending a test to otel_detached_tests.rs; kept both.

@willkill07

Copy link
Copy Markdown
Member

/ok to test 1a42d6a

@willkill07
willkill07 merged commit b13bdf6 into NVIDIA:main Nov 3, 2026
93 of 94 checks passed

This branch was previously deployed

1 inactive deployment
fern — 1a42d6a1 Deployed Nov 3, 2026 by copy-pr-bot[bot] via Preview docs #6936
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature a new feature lang:rust PR changes/introduces Rust code size:L PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Report OTLP partial success as a runtime diagnostic

2 participants