Skip to content

enhancement: add environment-backed exporter headers to direct APIs - #901

Draft
ericevans-nv wants to merge 1 commit into
NVIDIA:mainfrom
ericevans-nv:feat/environment-backed-exporter-headers
Draft

enhancement: add environment-backed exporter headers to direct APIs#901
ericevans-nv wants to merge 1 commit into
NVIDIA:mainfrom
ericevans-nv:feat/environment-backed-exporter-headers

Conversation

@ericevans-nv

Copy link
Copy Markdown
Contributor

Overview

Direct OpenTelemetry subscribers accepted resolved static headers, but did not provide the environment-backed header configuration already available to declarative exporter configuration.

This adds consistent header_env support to direct trace, log, and metric APIs across Rust, Python, Node.js, and Go. Environment values are resolved once when the subscriber is constructed and are used only as outbound exporter headers.

  • 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

  • Map each outbound header name to the environment variable supplying its value.
  • Resolve and snapshot environment-derived values during subscriber construction.
  • Preserve existing static headers behavior.
  • Reject missing, blank, padded, or invalid environment references and values.
  • Reject duplicate header names across headers and header_env, including ASCII case collisions.
  • Keep resolved values out of telemetry payloads, Event data, resource attributes, errors, and runtime diagnostics.
  • Add equivalent direct configuration surfaces for Rust, Python, Node.js, and Go.
  • Add versioned C FFI constructors while preserving existing constructor compatibility.
  • Avoid exposing low-level environment read details in declarative plugin errors.
  • Document the direct API lifecycle, snapshot behavior, validation rules, and secret-handling boundary.

Validation completed against the committed implementation:

  • Focused Rust header_env tests: 11 passed.
  • Real localhost OTLP HTTP exporter request test: passed and verified the activation-time header snapshot, nonempty payload, and secret non-disclosure.
  • Versioned FFI constructor tests: passed.
  • Focused Python tests: 5 passed.
  • Focused Node.js constructor, request, and public type tests: passed.
  • Focused Go subscriber and localhost request tests: passed.
  • File-scoped pre-commit checks: passed, including Rust formatting, Clippy, checks, FFI header synchronization, Python lint/type checks, Go formatting/vet, Node formatting, and documentation links.
  • Documentation build: passed with zero errors.

PR-readiness limitation: just test-rust stopped in the unchanged nemo-relay-cli --lib test surface while a Cursor-managed Relay listener was active. The remaining full language matrix and all-file pre-commit were not repeated under the approved validation waiver.

Where should the reviewer start?

Start with crates/core/src/observability/otel_signal.rs, which implements the shared validation and activation-time resolution contract. Then review crates/core/tests/unit/observability/otel_tests.rs for the real localhost request, snapshot, collision, invalid-value, and non-disclosure coverage.

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

Signed-off-by: Eric Evans <194135482+ericevans-nv@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

@github-actions github-actions Bot added size:XL PR is extra large Improvement improvement to existing functionality 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 Aug 25, 2026
@github-actions

Copy link
Copy Markdown

@willkill07 willkill07 added this to the 0.9 milestone Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement improvement to existing functionality 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.

[Enhancement]: Provide consistent environment-backed exporter headers across bindings

2 participants