Skip to content

feat(observability): add OTLP TLS and mTLS configuration - #1422

Merged
willkill07 merged 4 commits into
NVIDIA:mainfrom
willkill07:feat/relay-1109-otlp-tls
Oct 21, 2026
Merged

willkill07 merged 4 commits into
NVIDIA:mainfrom
willkill07:feat/relay-1109-otlp-tls

Conversation

@willkill07

@willkill07 willkill07 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Overview

Let Relay send OTLP data directly to collectors that require TLS or mutual TLS (mTLS). Add an optional tls object for each plugin or code endpoint, plus support for the standard OTLP certificate environment variables.

  • 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

  • Add shared certificate, client certificate, and private key file settings across Rust, Python, Node.js, Go, and the C FFI. Keep credentials separate for each endpoint. Copy TLS settings when Relay derives log or metric endpoints from traces.
  • Support TLS and mTLS for traces, logs, and metrics over gRPC and HTTP/protobuf. Automatic HTTP/JSON exporters use the same TLS settings. Settings for one signal take priority over shared settings.
  • Validate certificate files and client certificate/key pairs. Keep server certificate and hostname checks enabled. Existing FFI entry points remain available, and the new TLS object is optional.
  • Add local collector tests for TLS, mTLS, independent client identities, environment precedence, and rejected certificates. Update the configuration guide and API documentation using the NVIDIA style guidance.

The following checks passed during implementation:

  • just test-rust: 6,042 tests passed with the inherited stderr-format override removed.
  • just test-python.
  • just test-node.
  • just --set ci true test-go.
  • Seven focused TLS tests.
  • just docs-linkcheck. The published redirect comparison was skipped because the documentation service returned 403.

The branch starts from the latest upstream main. Staged pre-commit checks and the seven TLS tests also passed on this base.

Where should the reviewer start?

Start with crates/core/src/observability/otel_tls.rs for the shared TLS settings and transport setup. Then review crates/core/tests/unit/observability/otel_tls_tests.rs for collector tests across code, plugin, and environment configuration.

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

Summary by CodeRabbit

  • New Features

    • Added optional TLS and mutual TLS support for OpenTelemetry traces, logs, and metrics.
    • Supports custom CA certificates, client certificates, and private keys for automatic and configured exporters.
    • Exposed TLS settings across Go, Node.js, Python, and FFI interfaces.
    • Added signal-specific environment variables, with signal settings taking precedence.
  • Bug Fixes

    • Added validation for HTTPS endpoints, certificate pairs, PEM files, and TLS configuration errors.
  • Documentation

    • Documented OpenTelemetry TLS configuration, environment variables, APIs, and validation requirements.

Add certificate and private key file settings for each OTLP endpoint across
plugins and language bindings. Support shared and signal-specific OTLP TLS
environment variables while keeping explicit endpoint credentials isolated.

Add collector-backed TLS tests and document the configuration contract.

Relates to RELAY-1109.

Signed-off-by: Will Killian <[email protected]>
@willkill07
willkill07 requested review from a team as code owners October 20, 2026 18:41
@github-actions github-actions Bot added size:XL PR is extra large Feature a new feature lang:go PR changes/introduces Go code lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code labels Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NeMo-Relay/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 7d3b30a1-ee81-48a5-ac47-1da821b3b764
📥 Commits

Reviewing files that changed from the base of the PR and between 0dc1d44 and 05e75f4.

⛔ Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 3
  • python/nemo_relay/__init__.py
  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py

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: 45
  • GitHub Check: Python / Package (linux-musl-arm64)
  • GitHub Check: Python / Package (macos-arm64)
  • GitHub Check: Node.js / Package (linux-musl-arm64)
  • GitHub Check: Python / Package (linux-arm64)
  • GitHub Check: Python / Test (linux-arm64)
  • GitHub Check: Node.js / Package (linux-arm64)
  • GitHub Check: Python / Package (linux-musl-amd64)
  • GitHub Check: Python / Package (windows-arm64)
  • GitHub Check: Node.js / Test (windows-arm64)
  • GitHub Check: Rust / Test (windows-amd64)
  • GitHub Check: Node.js / Package (linux-musl-amd64)
  • GitHub Check: Python / Test (windows-amd64)
  • GitHub Check: Python / Package (windows-amd64)
  • GitHub Check: Python / Test (windows-arm64)
  • GitHub Check: Python / Test (linux-amd64)
  • GitHub Check: Rust / Package (macos-arm64)
  • GitHub Check: Rust / Test (linux-arm64)
  • GitHub Check: Check / Run
  • GitHub Check: Rust / Package (linux-musl-amd64)
  • GitHub Check: Node.js / Test (macos-arm64)
  • GitHub Check: Rust / Test (linux-amd64)
  • GitHub Check: Rust / Package (linux-arm64)
  • GitHub Check: Node.js / Package (macos-arm64)
  • GitHub Check: Python / Package (linux-amd64)
  • GitHub Check: Node.js / Test (windows-amd64)
  • GitHub Check: Node.js / Package (linux-amd64)
  • GitHub Check: Go / Test (macos-arm64)
  • GitHub Check: Node.js / Test (linux-amd64)
  • GitHub Check: Rust / Package (linux-amd64)
  • GitHub Check: Node.js / Package (windows-arm64)
  • GitHub Check: Rust / Package (linux-musl-arm64)
  • GitHub Check: Node.js / Package (windows-amd64)
  • GitHub Check: Node.js / Package OpenClaw plugin
  • GitHub Check: Rust / Package (windows-arm64)
  • GitHub Check: Python / Test (macos-arm64)
  • GitHub Check: Node.js / Test (linux-arm64)
  • GitHub Check: Rust / Package (windows-amd64)
  • GitHub Check: Go / Test (windows-amd64)
  • GitHub Check: Rust / Test (windows-arm64)
  • GitHub Check: Rust / Test (macos-arm64)
  • GitHub Check: Go / Test (windows-arm64)
  • GitHub Check: Go / Test (linux-amd64)
  • GitHub Check: Go / Test (linux-arm64)
  • GitHub Check: License Diff / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📚 Code guidelines: 1
CONTRIBUTING.md — configured
📓 Path-based instructions: 4
Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.

⚙️ CodeRabbit configuration file

Files:

  • python/tests/test_observability_plugin.py
Review Python wrapper changes for typed API consistency, contextvars-based scope isolation, async behavior, and parity with the native extension.

⚙️ CodeRabbit configuration file

Files:

  • python/nemo_relay/__init__.py
  • python/nemo_relay/observability.py
Applicability reference: AGENTS.md: # NeMo Relay Repository Guidance See `CONTRIBUTING.md` and `docs/contribute/testing-and-docs.mdx` for contributor details, and `.agents/skills/README.md` for the maintainer skill boundary.

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • python/nemo_relay/__init__.py
  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
Applicability reference: AGENTS.md: # NeMo Relay Repository Guidance See `CONTRIBUTING.md` and `docs/contribute/testing-and-docs.mdx` for contributor details, and `.agents/skills/README.md` for the maintainer skill boundar...

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • python/nemo_relay/__init__.py
  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
🔇 Additional comments: 3
python/nemo_relay/__init__.py: 1

130-130: LGTM!

Also applies to: 847-847

python/nemo_relay/observability.py: 1

13-14: LGTM!

Also applies to: 448-448, 460-469

python/tests/test_observability_plugin.py: 1

836-866: LGTM!

Walkthrough

OTLP trace, log, and metric exporters now support custom CA certificates and client certificates. TLS settings are available through endpoint configuration, automatic-exporter environment variables, plugin configuration, FFI constructors, and Go, Node.js, and Python APIs.

Changes

OpenTelemetry TLS

Layer / File(s) Summary
TLS configuration and transport
crates/core/Cargo.toml, crates/core/src/observability/{mod.rs,otel_tls.rs,otel_signal.rs}
Adds TLS configuration, PEM loading and validation, and signal-specific automatic HTTP and gRPC TLS setup.
Exporter and plugin integration
crates/core/src/observability/{otel.rs,otel_logs.rs,otel_metrics.rs,plugin_component.rs}, crates/core/tests/unit/observability/*
Applies TLS settings to trace, log, and metric exporters. Plugin endpoints expose and validate TLS settings. Tests cover configuration, TLS/mTLS exports, and automatic environment settings.
TLS-aware FFI constructors
crates/ffi/nemo_relay.h, crates/ffi/src/api/observability.rs
Adds TLS-aware trace, log, and metric subscriber constructors. Existing constructors pass no TLS configuration.
Language APIs and documentation
go/nemo_relay/*, crates/node/{observability.d.ts,src/api/mod.rs,tests/*}, crates/python/src/py_types/*, python/nemo_relay/*, python/tests/*, docs/configure-plugins/observability/opentelemetry.mdx
Exposes and serializes TLS settings through Go, Node.js, and Python APIs. Documents endpoint configuration and automatic-exporter environment variables. Adds binding and validation tests.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant OpenTelemetryConfig
  participant OpenTelemetryTlsConfig
  participant OTLP_exporter
  participant OTLP_collector
  OpenTelemetryConfig->>OTLP_exporter: provide endpoint and TLS settings
  OTLP_exporter->>OpenTelemetryTlsConfig: build configured HTTP or gRPC transport
  OpenTelemetryTlsConfig-->>OTLP_exporter: return validated TLS transport
  OTLP_exporter->>OTLP_collector: send OTLP request
Loading
Merge Risk: ⚪ Minimal · up to 05e75

No actionable merge-blocking risk is established in the reviewed changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 45.92% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 98 functions across 27 files. 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 required Conventional Commits format, includes the lowercase type and scope, summarizes the OTLP TLS and mTLS change, stays under 72 characters, and has no trailing period.
Description check Passed The description includes all required sections, completed overview confirmations, detailed implementation and testing information, reviewer guidance, and related issues using the required action keywo…
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: Description check

Explanation

The description includes all required sections, completed overview confirmations, detailed implementation and testing information, reviewer guidance, and related issues using the required action keyword.

✨ 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

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 (479 packages)
[license-diff] current: generating Node inventory
[license-diff] current: Node inventory complete (424 packages)
[license-diff] current: generating Python inventory
[license-diff] current: Python inventory complete (115 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 (479 packages)
[license-diff] base: generating Node inventory
[license-diff] base: Node inventory complete (424 packages)
[license-diff] base: generating Python inventory
[license-diff] base: Python inventory complete (115 packages)
[license-diff] base inventory complete
[license-diff] removing temporary base worktree
[license-diff] comparing inventories
[license-diff] rendering Markdown output
[license-diff] done

@willkill07 willkill07 self-assigned this Oct 20, 2026
@willkill07 willkill07 added this to the 0.11 milestone Oct 20, 2026
@github-actions

Copy link
Copy Markdown

@willkill07 willkill07 changed the title feat: add OTLP TLS and mTLS configuration feat(observability): add OTLP TLS and mTLS configuration Oct 20, 2026
Comment thread crates/core/src/observability/otel.rs Resolved
@willkill07
willkill07 merged commit 1523b32 into NVIDIA:main Oct 21, 2026
97 checks passed
@willkill07
willkill07 deleted the feat/relay-1109-otlp-tls branch October 30, 2026 14:46

This branch was previously deployed

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

Labels

Feature a new feature lang:go PR changes/introduces Go code lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code size:XL PR is extra large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants