Skip to content

fix: enforce transport policy for automatic OTLP logs and metrics - #1523

Merged
willkill07 merged 1 commit into
NVIDIA:mainfrom
willkill07:fix/relay-1141-automatic-otel-transport
Oct 26, 2026
Merged

willkill07 merged 1 commit into
NVIDIA:mainfrom
willkill07:fix/relay-1141-automatic-otel-transport

Conversation

@willkill07

@willkill07 willkill07 commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Overview

Automatic OpenTelemetry logs and metrics could export payloads to remote plaintext HTTP collectors when no OTLP headers were configured. Apply the same transport policy as traces, rejecting disallowed destinations with signal-specific diagnostics.

  • 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

  • Validate automatic log and metric endpoints regardless of configured headers, preserving HTTPS, loopback, and explicit host permissions.
  • Share transport validation across signals while retaining trace, log, or metric context in errors.
  • Align plaintext preflight diagnostics with activation behavior and remove the unused header-presence gate.
  • Update regression coverage and the documented automatic exporter transport policy.

Validation:

  • Latest focused Rust run: 36 passed.
  • just test-rust: 6,533 passed, one unrelated CLI assertion failed, four skipped. invocation_diagnostic_does_not_preflight_live_launches expects error_kind=io but receives JSON containing "error_kind":"io". One gateway timeout test passed on retry.
  • just docs-linkcheck: passed; the published-redirect comparison was skipped because FDR returned HTTP 403.
  • Staged repository hooks: formatting, Clippy, Cargo check, docs linkcheck, Python audit, and npm audit passed. cargo deny failed on existing zstd/zstd-safe advisories RUSTSEC-2026-0391, RUSTSEC-2026-0398, RUSTSEC-2026-0403, and RUSTSEC-2026-0410; Cargo.lock is unchanged from upstream.

Where should the reviewer start?

Start with automatic endpoint validation in crates/core/src/observability/otel_logs.rs and otel_metrics.rs, then the signal-specific transport errors in header_file.rs. The regression tests in crates/core/tests/unit/observability/plugin_component_tests.rs cover rejection without headers, activation warnings, preflight diagnostics, and allowed hosts.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • Bug Fixes
    • Trace, log, and metric export endpoints now follow consistent transport security checks, whether or not headers are configured.
    • Remote endpoints must use HTTPS. HTTP remains allowed for localhost, loopback addresses, and hosts explicitly permitted by configuration.
    • Automatic exporters now skip endpoints that fail transport validation, with diagnostics identifying the affected signal.

@willkill07
willkill07 requested review from a team as code owners October 26, 2026 14:22
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between af91eee and 65bd26d.

Files selected for processing: 9
  • crates/core/src/observability/header_file.rs
  • crates/core/src/observability/otel.rs
  • crates/core/src/observability/otel_logs.rs
  • crates/core/src/observability/otel_metrics.rs
  • crates/core/src/observability/otel_signal.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/tests/unit/observability/header_file_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • docs/configure-plugins/observability/opentelemetry.mdx
Files with no reviewable changes: 1
  • crates/core/src/observability/otel_signal.rs

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

Recent review details
Context from checks skipped due to timeout: 4
  • GitHub Check: Prepare
  • GitHub Check: Detect docs changes
  • GitHub Check: request / require-nvskills-ci / require-nvskills-ci
  • GitHub Check: Apply PR labels
Additional context used
Code guidelines: 4
.agents/skills/contribute-docs/SKILL.md — configured
.agents/skills/contribute-integration/SKILL.md — configured
.agents/skills/maintain-observability/SKILL.md — configured
.agents/skills/review-doc-style/SKILL.md — configured
Path-based instructions: 9
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/core/tests/unit/observability/header_file_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.

CodeRabbit configuration file

Files:

  • crates/core/src/observability/otel.rs
  • crates/core/src/observability/otel_metrics.rs
  • crates/core/src/observability/header_file.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel_logs.rs
  • crates/core/tests/unit/observability/header_file_tests.rs
  • crates/core/tests/unit/observability/plugin_component_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: Keep NeMo Relay optional Source excerpt: Use stable, documented framework or plugin APIs Source excerpt: Wrap tool and LLM paths at the correct framework boundary Source excerpt: Preserve the framework's original behavior wh...

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

Files:

  • crates/core/src/observability/otel.rs
  • docs/configure-plugins/observability/opentelemetry.mdx
  • crates/core/src/observability/otel_metrics.rs
  • crates/core/src/observability/header_file.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel_logs.rs
  • crates/core/tests/unit/observability/header_file_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
Source excerpt: [ ] Do examples and docs use each exporter's documented flush/deregister order before shutdown?

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

Files:

  • docs/configure-plugins/observability/opentelemetry.mdx
`crates/core/src/observability/otel.rs`

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

Files:

  • crates/core/src/observability/otel.rs
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
Source excerpt: Docs under `docs/about-nemo-relay/concepts/subscribers.mdx` and `docs/configure-plugins/observability/`

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

Files:

  • docs/configure-plugins/observability/opentelemetry.mdx
Additional comments: 8
crates/core/src/observability/header_file.rs: 1

203-204: LGTM!

Also applies to: 207-207, 209-209, 213-213, 216-216, 220-220

crates/core/src/observability/otel.rs: 1

31-31: LGTM!

Also applies to: 314-315

crates/core/tests/unit/observability/header_file_tests.rs: 1

113-113: LGTM!

Also applies to: 131-131, 160-161, 171-171, 532-544, 546-563, 565-581

crates/core/src/observability/otel_logs.rs: 1

40-40: LGTM!

Also applies to: 50-54, 290-297

crates/core/src/observability/otel_metrics.rs: 1

42-42: LGTM!

Also applies to: 52-53, 327-334

crates/core/src/observability/plugin_component.rs: 1

4512-4512: LGTM!

Also applies to: 4572-4573, 4575-4575, 4589-4589, 4595-4595

crates/core/tests/unit/observability/plugin_component_tests.rs: 1

19-19: LGTM!

Also applies to: 514-514, 516-544, 549-549, 552-552, 555-558, 562-589, 703-703, 2503-2503, 2513-2519

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

143-144: LGTM!

Also applies to: 148-148

Walkthrough

Automatic OTLP transport validation now applies to trace, log, and metric endpoints regardless of header configuration. The validator includes the signal name in transport errors. Preflight diagnostics and tests cover all three signals.

Changes

OTLP endpoint transport validation

Layer / File(s) Summary
Generic transport validator and trace integration
crates/core/src/observability/header_file.rs, crates/core/src/observability/otel.rs, crates/core/tests/unit/observability/header_file_tests.rs
The transport validator accepts a signal name and includes it in HTTPS policy errors. Trace validation uses the generic typed validator. Tests cover signal-specific errors, error types, and endpoint redaction.
Automatic signal endpoint validation
crates/core/src/observability/otel_logs.rs, crates/core/src/observability/otel_metrics.rs, crates/core/src/observability/otel_signal.rs, crates/core/src/observability/plugin_component.rs, crates/core/tests/unit/observability/plugin_component_tests.rs, docs/configure-plugins/observability/opentelemetry.mdx
Automatic log and metric configuration now requires nonblank endpoints and validates transport regardless of headers. Preflight checks trace, log, and metric endpoints and reports skips for each signal. Tests and documentation reflect the transport policy.

Priority: Normal

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

Change: Bug fix

Possibly related PRs

  • NVIDIA/NeMo-Relay#1489: Introduced typed automatic exporter errors and the trace-specific transport validator that this change generalizes.
  • NVIDIA/NeMo-Relay#1487: Added diagnostics for skipped automatic OpenTelemetry exporters, which this change updates for all three signals.
  • NVIDIA/NeMo-Relay#1477: Added plaintext-destination preflight validation, which this change extends to automatic logs and metrics without headers.
Merge Risk: Minimal · up to 65bd2

The transport-policy change appears mergeable after normal checks; no actionable issue was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 7 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title uses the conventional type "fix:" and summarizes the main change: enforcing the transport policy for automatic OTLP logs and metrics, which matches the changeset (otel_logs.rs, otel_metrics.…
Description check Passed The description follows the repository template. It includes the Overview with both checkboxes marked, the Details section listing the changes, the Where should the reviewer start section pointing to …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses the conventional type "fix:" and summarizes the main change: enforcing the transport policy for automatic OTLP logs and metrics, which matches the changeset (otel_logs.rs, otel_metrics.rs, header_file.rs, and the related tests and docs). It is 65 characters, under the 72-character limit, has no trailing period, and is written in imperative form with lowercase type. It is not a breaking change, so no '!' is needed.

Full details: Description check

Explanation

The description follows the repository template. It includes the Overview with both checkboxes marked, the Details section listing the changes, the Where should the reviewer start section pointing to specific files and tests, and the Related Issues section with 'Fixes [RELAY-1141]'. It also adds a Validation section, which the template does not require but which does not conflict with it. The Overview states the problem and the fix clearly.

Full details: Docstring Coverage

Explanation

Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 7 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

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:M PR is medium Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Oct 26, 2026
@willkill07 willkill07 self-assigned this Oct 26, 2026
@willkill07 willkill07 added this to the 0.11 milestone Oct 26, 2026
@github-actions

Copy link
Copy Markdown

@willkill07
willkill07 merged commit 191be82 into NVIDIA:main Oct 26, 2026
94 of 97 checks passed
@willkill07
willkill07 deleted the fix/relay-1141-automatic-otel-transport branch October 30, 2026 14:46

This branch was previously deployed

1 inactive deployment
fern — 65bd26d2 Deployed Oct 26, 2026 by willkill07 via Clean up docs preview #6579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants