Skip to content

fix: validate TLS files before exporter startup - #1478

Merged
willkill07 merged 2 commits into
NVIDIA:mainfrom
willkill07:fix/relay-1117-tls-preflight
Oct 23, 2026
Merged

willkill07 merged 2 commits into
NVIDIA:mainfrom
willkill07:fix/relay-1117-tls-preflight

Conversation

@willkill07

@willkill07 willkill07 commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Overview

TLS validation can report success even when certificate or key files are unusable. This change reports these errors before startup.

  • 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

  • Report missing, unreadable, empty, or invalid TLS files.
  • Report client certificates and private keys that do not match.
  • Check files without connecting to the collector, and check them again at startup.
  • Add tests for traces, logs, and metrics over HTTP and gRPC.
  • Explain which files must be available during validation.

Validation:

  • All eight focused TLS tests passed.
  • Python, Node.js, and Go suites passed. Python used version 3.13.
  • The Rust suite had 6,461 passes and one CLI test failure. An inherited JSON log setting caused the failure. That test passed when rerun without the setting.
  • Repository hooks passed.

No public API changes.

Where should the reviewer start?

Start with crates/core/src/observability/otel_tls.rs, then review the new validation test in crates/core/tests/unit/observability/otel_tls_tests.rs.

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

Summary by CodeRabbit

  • Bug Fixes

    • TLS configuration validation now checks certificate and key files for readability, valid PEM formatting, and matching client identities without connecting to the collector. Invalid settings are reported at the affected endpoint without exposing secret contents.
    • Certificate and key files are checked again when the exporter starts. If files change after validation, recreate the exporter to use the updated files.
  • Documentation

    • Updated OpenTelemetry guidance to clarify which TLS checks happen during plugin validation and which happen at exporter startup.

@willkill07
willkill07 requested review from a team as code owners October 23, 2026 16:18
@github-actions github-actions Bot added size:S PR is small Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between b98891d and 6ce978d.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 9d50b6a and b98891d.

📒 Files selected for processing: 3
  • crates/core/src/observability/otel_tls.rs
  • crates/core/tests/unit/observability/otel_tls_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: 2
  • GitHub Check: Changes / Detect
  • GitHub Check: Preview docs
🧰 Additional context used
📚 Code guidelines: 5
.agents/skills/contribute-docs/SKILL.md — configured
RELEASING.md — auto-discovered
.agents/skills/maintain-observability/SKILL.md — configured
CONTRIBUTING.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/otel_tls_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/otel_tls_tests.rs
  • crates/core/src/observability/otel_tls.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
Applicability reference: AGENTS.md: # NeMo Relay Repository Guidance Keep release-process policy in maintainer sources such as `RELEASING.md` and Source excerpt: Do not copy full GitHub Release notes into `CHANGELOG.md` or the docs site.

📄 CodeRabbit inference engine (RELEASING.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
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:

  • 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: 1
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Relay PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-19T23:46:28.573Z
Learning: Source excerpt:
# NeMo Relay Repository Guidance

## Validation

5. Use `uv run pre-commit run` for repository hooks; it checks the staged
   changes. Reserve `--all-files` for an explicit request, release preparation,
   or CI.
🔇 Additional comments: 3
crates/core/src/observability/otel_tls.rs: 1

14-15: LGTM!

Also applies to: 59-70, 107-107

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

136-204: LGTM!

Also applies to: 206-242

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

398-402: LGTM!

Also applies to: 404-405

Walkthrough

Relay now checks configured TLS files during plugin preflight and again when starting the exporter. Preflight reports invalid PEM material and mismatched client certificates and keys without connecting to the collector.

Changes

OTLP TLS preflight

Layer / File(s) Summary
Validate TLS material during preflight
crates/core/src/observability/otel_tls.rs
validate loads PEM files and checks certificate parsing and key compatibility. load calls validate_shape before loading the files.
Cover preflight and exporter-start checks
crates/core/tests/unit/observability/otel_tls_tests.rs, docs/configure-plugins/observability/opentelemetry.mdx
Tests cover valid and invalid TLS configurations across telemetry signals and transports, including diagnostics that do not disclose secret contents. Documentation describes preflight checks and the second check at exporter start.

Priority: ➖ Normal

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

Change: Bug fix

Possibly related PRs

Merge Risk: ⚪ Minimal · up to b9889

No actionable TLS preflight or exporter-start risk was identified; the change is mergeable 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 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. (1 skipped: 1… 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 allowed fix type, follows Conventional Commits syntax, summarizes the TLS validation change, stays under 72 characters, and has no trailing period.
Description check Passed The description includes all required sections, explains the change, identifies reviewer starting points, records validation results, and links a related issue with the Fixes keyword.
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 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 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.

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

Copy link
Copy Markdown

@greysonlalonde greysonlalonde 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.

lgtm!

@mnajafian-nv mnajafian-nv 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.

lgtm

@willkill07
willkill07 merged commit 25c8470 into NVIDIA:main Oct 23, 2026
160 of 162 checks passed
@willkill07
willkill07 deleted the fix/relay-1117-tls-preflight branch October 30, 2026 14:46

This branch was previously deployed

1 inactive deployment
fern — 6ce978db Deployed Oct 23, 2026 by willkill07 via Clean up docs preview #6463
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:S PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants