Repository navigation
fix: report skipped automatic OpenTelemetry exporters - #1487
Conversation
Signed-off-by: Eric Evans II <[email protected]>
Signed-off-by: Eric Evans II <[email protected]>
Signed-off-by: Eric Evans II <[email protected]>
Signed-off-by: Eric Evans II <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
WalkthroughAutomatic 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. ChangesAutomatic OpenTelemetry exporters
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Possibly related PRs
Merge Risk: ⚪ Minimal · up to
|
…skip-diagnostics Signed-off-by: Eric Evans II <[email protected]>
Signed-off-by: Eric Evans II <[email protected]>
…skip-diagnostics Signed-off-by: Eric Evans II <[email protected]>
|
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 |
#### 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]>
Overview
A named HTTP collector supplied through an automatic OTLP environment variable can be rejected by
insecure_http_hostswhile 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.Details
observability.automatic_otel_signal_skippedin the activation report. The existing plaintext host policy still rejects unallowlisted HTTP destinations; a rejected exporter does not fail plugin activation.OTEL_EXPORTER_OTLP_*_ENDPOINTvariable orOTEL_EXPORTER_OTLP_ENDPOINT. Include only the parsed scheme, host, and port; omit URL credentials, paths, queries, and header values.Validation: the four focused observability regression tests passed before the conflict-free
upstream/mainmerge, 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_subscriberincrates/core/src/observability/plugin_component.rsto see where a rejected exporter becomes an activation diagnostic. Then review the nonfatal and redaction assertions incrates/core/tests/unit/observability/plugin_component_tests.rs.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit