Skip to content

fix: report skipped automatic OpenTelemetry exporters - #1487

Merged
willkill07 merged 7 commits into
NVIDIA:mainfrom
ericevans-nv:fix/automatic-otel-skip-diagnostics
Oct 23, 2026
Merged

willkill07 merged 7 commits into
NVIDIA:mainfrom
ericevans-nv:fix/automatic-otel-skip-diagnostics

Conversation

@ericevans-nv

@ericevans-nv ericevans-nv commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Overview

A named HTTP collector supplied through an automatic OTLP environment variable can be rejected by insecure_http_hosts while plugin activation succeeds. Previously, Relay logged the skipped exporter but returned no activation diagnostic, leaving operators with missing telemetry and no programmatic explanation. This change adds a redacted warning to the activation report while keeping startup and valid exporters available.

  • 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

  • When automatic trace, log, or metric exporter construction fails, record observability.automatic_otel_signal_skipped in the activation report. The existing plaintext host policy still rejects unallowlisted HTTP destinations; a rejected exporter does not fail plugin activation.
  • Identify the affected signal and whether its endpoint came from a signal-specific OTEL_EXPORTER_OTLP_*_ENDPOINT variable or OTEL_EXPORTER_OTLP_ENDPOINT. Include only the parsed scheme, host, and port; omit URL credentials, paths, queries, and header values.
  • Add regression coverage for a rejected named HTTP trace destination, a valid metric or configured destination alongside a rejected one, the generic endpoint variable, an allowlisted named host, and malformed headers. The tests assert activation results and diagnostics; they do not claim live collector delivery.
  • Make the loaded TLS PEM binding mutable so the existing validation path can call its client builder, and document the activation warning in the OpenTelemetry guide.

Validation: the four focused observability regression tests passed before the conflict-free upstream/main merge, which changed separate ATIF files. The commit hooks passed, including Cargo formatting, Clippy, Cargo check, and documentation link checking. The full Rust suite was stopped locally; the Python suite and full documentation build were not run locally for this final branch. PR CI provides broader validation.

Where should the reviewer start?

Start with automatic_subscriber in crates/core/src/observability/plugin_component.rs to see where a rejected exporter becomes an activation diagnostic. Then review the nonfatal and redaction assertions in crates/core/tests/unit/observability/plugin_component_tests.rs.

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

Summary by CodeRabbit

  • New Features
    • Automatic OpenTelemetry exporters can now use a comma-separated host allowlist to permit plaintext HTTP. The setting applies only to automatic exporters; configured host policies remain in effect when it is blank or invalid.
  • Bug Fixes
    • Activation warnings now identify which signal was skipped and the relevant endpoint setting. When available, warnings include the endpoint’s origin while omitting credentials, paths, and query values.
  • Documentation
    • Added guidance on the host allowlist, invalid values, and automatic exporter warning details.

@ericevans-nv
ericevans-nv requested review from a team as code owners October 23, 2026 19:56
@github-actions github-actions Bot added the size:S PR is small label Oct 23, 2026
@github-actions github-actions Bot added the Bug issue describes bug; PR fixes bug label Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 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 e31a477 and 87588b1.

📒 Files selected for processing: 3
  • crates/core/src/observability/plugin_component.rs
  • crates/core/tests/unit/observability/plugin_component_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; 10 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 2
  • GitHub Check: Changes / Detect
  • GitHub Check: Preview docs
🧰 Additional context used
📚 Code guidelines: 3
.agents/skills/contribute-docs/SKILL.md — configured
.agents/skills/maintain-observability/SKILL.md — configured
.agents/skills/review-doc-style/SKILL.md — configured
📓 Path-based instructions: 7
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/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/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.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: [ ] 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
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
🧠 Learnings: 2
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: .agents/skills/maintain-observability/SKILL.md:0-0
Timestamp: 2026-10-19T23:41:47.348Z
Learning: Source excerpt:
# Maintain Observability Surfaces

Use this skill when changing event fields, exporter behavior, subscriber config,
or binding parity for ATIF or the `full`, `gen_ai`, and `openinference`
OpenTelemetry projections.
📚 Learning: 2026-08-13T22:55:06.939Z
Learnt from: bbednarski9
Repo: NVIDIA/NeMo-Relay PR: 780
File: crates/core/tests/unit/observability/otel_logs_tests.rs:48-61
Timestamp: 2026-08-13T22:55:06.939Z
Learning: In NVIDIA/NeMo-Relay OTLP observability tests, do not require plugin diagnostic fields for direct LogEventProcessor or metric-subscriber helper coverage, because those helpers intentionally omit plugin diagnostics. Assert runtime diagnostic fields only through activated-plugin coverage, where endpoint-specific diagnostic fields are available.

Applied to files:

  • crates/core/tests/unit/observability/plugin_component_tests.rs
🔇 Additional comments: 3
crates/core/src/observability/plugin_component.rs: 1

94-94: LGTM!

Also applies to: 1452-1454, 1469-1471, 1481-1481, 2084-2085, 2088-2088, 2092-2093, 2099-2100, 2131-2169, 2175-2176

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

557-877: LGTM!

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

149-155: LGTM!

Also applies to: 867-874

Walkthrough

Automatic OpenTelemetry exporters now use a plaintext-host policy that can include hosts from an environment override. Exporter construction failures produce activation warnings with endpoint-source details and a redacted origin when available.

Changes

Automatic OpenTelemetry exporters

Layer / File(s) Summary
Automatic plaintext host policy
crates/core/src/observability/plugin_component.rs, crates/core/tests/unit/observability/plugin_component_tests.rs, docs/configure-plugins/observability/opentelemetry.mdx
Automatic exporters combine configured insecure HTTP hosts with valid hosts from NEMO_RELAY_OTEL_INSECURE_HTTP_HOSTS. Blank overrides preserve the configured policy. Invalid overrides produce a warning and preserve that policy. Tests and documentation describe the automatic-only behavior.
Exporter failure diagnostics
crates/core/src/observability/plugin_component.rs, crates/core/tests/unit/observability/plugin_component_tests.rs, docs/configure-plugins/observability/opentelemetry.mdx
When automatic subscriber construction fails, a warning identifies the signal-specific endpoint variable or the generic endpoint variable. The warning includes a parseable redacted origin. Tests check warning behavior and secret redaction; documentation describes the warning.

Priority: ⬇️ Low

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

Change: Bug fix

Possibly related PRs

  • NVIDIA/NeMo-Relay#1477: It validates plaintext observability destinations against an allowlist during preflight; this PR applies a related plaintext-host policy to automatic OTLP exporters.
Merge Risk: ⚪ Minimal · up to 87588

The automatic-exporter policy and skipped-exporter warnings have no identified merge-blocking issue. Merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 3 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 follows Conventional Commits format. It uses the allowed lowercase type "fix", provides a concise imperative summary, stays under 72 characters, and has no trailing period.
Description check Passed The description includes all required sections, completed checklist items, implementation details, reviewer guidance, validation status, and a correctly formatted related issue reference.
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: Docstring Coverage

Explanation

Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 3 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 the lang:rust PR changes/introduces Rust code label Oct 23, 2026
@ericevans-nv ericevans-nv self-assigned this Oct 23, 2026
@ericevans-nv ericevans-nv added this to the 0.11 milestone Oct 23, 2026
@github-actions

Copy link
Copy Markdown

@bbednarski9 bbednarski9 self-assigned this Oct 23, 2026
@github-actions github-actions Bot added size:M PR is medium and removed size:S PR is small labels Oct 23, 2026
@bbednarski9

Copy link
Copy Markdown
Collaborator

Im thinking of doing a follow-up PR as follows. We can use this PR as a narrow fix for the existing gap and do a quick follow-up.

Classify exporter construction failures at their source, record a typed observation with a safe reason, and derive the activation warning from that same classification

@willkill07
willkill07 enabled auto-merge (squash) October 23, 2026 20:35
@willkill07
willkill07 merged commit 71cd5d8 into NVIDIA:main Oct 23, 2026
97 checks passed
willkill07 added a commit that referenced this pull request Oct 24, 2026
#### Overview

Close the gap between successful plugin activation and skipped automatic
OpenTelemetry exporters. A rejected trace, log, or metric exporter now
contributes structured initialization evidence to the layered runtime
diagnostics surface, while healthy exporters continue operating.

This follows merged #1487 and makes partial observability setup failures
discoverable through the same diagnostics model used for plugin
ownership, failure classification, and retained history.

Dependency audit remediation is reviewed separately in #1490 and has
been removed from this PR's net diff. After #1490 merges, rebase this PR
onto main, omitting both the original dependency commit (`aacd1ff7`) and
its removal commit (`4f82320d`) so the dependency fixes remain on main.

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

#### Details

**1. Preserve the cause from exporter construction through diagnostics**

- Retain typed endpoint, transport-policy, TLS-validation, and
TLS-file-read causes internally.
- Record `plugin.exporter_initialization_failed` with activation phase
and warning severity. Classify proven input failures as `invalid_input`,
plaintext-policy rejection as `policy_rejected`, and TLS file-read
failures as `io`. Causes available only as backend strings remain
`unknown`.
- Share a safe explanation with the activation report, including both
HTTP allowlist configuration options. New diagnostic evidence excludes
credentials, sensitive URL components, TLS file paths, and PEM content.

See [cause classification and automatic subscriber
activation](https://github.com/NVIDIA/NeMo-Relay/blob/4f82320d075fc202e5055ae0f2c6de5d2f9d7178/crates/core/src/observability/plugin_component.rs#L2173).

**2. Integrate with layered ownership, admission, and retention**

- Use bounded identities for `opentelemetry.automatic.traces`,
`opentelemetry.automatic.logs`, and `opentelemetry.automatic.metrics`,
retaining the originating plugin's ownership.
- Close each scoped recorder after the failed initialization attempt.
Retained counters remain selectable when recent-event capacity is zero.
- Preserve nonfatal activation, healthy signals, and existing warnings
when diagnostics are disabled or admission fails. State-only recording
avoids duplicate log projections.
- Document collection and retention limits: the evidence describes
initialization history, with availability governed by enabled/admitted
collection and bounded retention.

See [nonfatal activation
recording](https://github.com/NVIDIA/NeMo-Relay/blob/4f82320d075fc202e5055ae0f2c6de5d2f9d7178/crates/core/src/plugin.rs#L1144).

**3. Preserve the existing exporter API contract**

- Keep the public `OpenTelemetryError` variant set,
`ExporterBuild(String)` behavior, and TLS file-read display text
unchanged. Typed causes remain crate-private until converted at public
API boundaries.
- Preserve diagnostic snapshot wire shape and binding reader APIs.
- Add one `CommonPluginFailureCode` catalogue variant for exporter
initialization; exhaustive Rust matches on that enum must account for
it. The addition does not require a catalogue-version bump.

See [public and internal error
types](https://github.com/NVIDIA/NeMo-Relay/blob/4f82320d075fc202e5055ae0f2c6de5d2f9d7178/crates/core/src/observability/otel.rs#L141)
and [public-constructor compatibility
coverage](https://github.com/NVIDIA/NeMo-Relay/blob/4f82320d075fc202e5055ae0f2c6de5d2f9d7178/crates/core/tests/unit/observability/otel_tls_tests.rs#L1193).

**4. Cover production activation**

- Exercise rejected HTTP traces alongside healthy metrics through the
production plugin host, plus endpoint/TLS classifications, signal
isolation, ownership, admission, and retention without recent events.

**Validation**

- The five dependency manifest, lockfile, and attribution files match
main exactly after removal. Diagnostics source, tests, and documentation
are unchanged; the diagnostics results below are from earlier
validation.
- Focused diagnostics and public API regressions: **10 passed**. Earlier
catalogue/wire-model checks: **32 passed**.
- Full `just test-rust`: **6,511 passed, 1 failed, 4 skipped**. The
previously observed [CLI
assertion](https://github.com/NVIDIA/NeMo-Relay/blob/4f82320d075fc202e5055ae0f2c6de5d2f9d7178/crates/cli/tests/cli_tests.rs#L4573)
still expects `error_kind=io` while the command emits JSON
`"error_kind":"io"`.
- Repository hooks were rerun for dependency removal. Both `uv audit`
and `npm audit` fail on dependencies inherited from main; remediation is
isolated in #1490. Other applicable hooks passed.
- Standalone Python, Node binding, and Go suites were not run; their
exposed contracts are unchanged.

#### Where should the reviewer start?

Start with [`automatic_exporter_failure` and
`automatic_subscriber`](https://github.com/NVIDIA/NeMo-Relay/blob/4f82320d075fc202e5055ae0f2c6de5d2f9d7178/crates/core/src/observability/plugin_component.rs#L2173),
then follow
[`record_nonfatal_activation_failure`](https://github.com/NVIDIA/NeMo-Relay/blob/4f82320d075fc202e5055ae0f2c6de5d2f9d7178/crates/core/src/plugin.rs#L1144)
into the layered diagnostics model.

The [production host
tests](https://github.com/NVIDIA/NeMo-Relay/blob/4f82320d075fc202e5055ae0f2c6de5d2f9d7178/crates/core/tests/unit/observability/plugin_component_tests.rs#L8887)
demonstrate the original partial-activation gap and retained evidence.
The [public error compatibility
test](https://github.com/NVIDIA/NeMo-Relay/blob/4f82320d075fc202e5055ae0f2c6de5d2f9d7178/crates/core/tests/unit/observability/otel_tls_tests.rs#L1193)
guards the API boundary.

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

- Relates to #1487.
- Relates to #1448.
- Relates to #1490 (dependency audit prerequisite).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Failed automatic OpenTelemetry exporters now appear as nonfatal,
per-signal activation warnings and, when diagnostics are enabled and
recording is available, as diagnostic observations. Other signals can
continue operating.
* Diagnostics classify failures such as invalid configuration, rejected
plaintext destinations, and file-read errors. Sensitive endpoint,
header, and certificate details are redacted.

* **Bug Fixes**
* Invalid endpoints and malformed header values now receive more
specific error classifications.

* **Documentation**
* Updated observability and diagnostics references to explain exporter
failure reporting and its limits.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Bryan Bednarski <[email protected]>
Co-authored-by: Will Killian <[email protected]>

This branch was previously deployed

1 inactive deployment
fern — 87588b18 Deployed Oct 23, 2026 by willkill07 via Clean up docs preview #6499
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.

3 participants