Skip to content

feat: configure OpenTelemetry batching per endpoint - #719

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
willkill07:feat/relay-626-otel-endpoint-batch-config
Aug 5, 2026
Merged

feat: configure OpenTelemetry batching per endpoint#719
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
willkill07:feat/relay-626-otel-endpoint-batch-config

Conversation

@willkill07

@willkill07 willkill07 commented Aug 5, 2026

Copy link
Copy Markdown
Member

Overview

Add endpoint-local OpenTelemetry batch processor configuration for observability config version 3. Omitted values continue to inherit the standard OTEL_BSP_* environment settings and SDK defaults.

  • 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 optional max_queue_size, max_export_batch_size, and scheduled_delay_millis fields to each configured OpenTelemetry endpoint.
  • Apply endpoint overrides after the environment-aware SDK batch defaults are constructed, preserving independent endpoint behavior and existing diagnostics, flush, and shutdown semantics.
  • Reject zero values and explicitly configured export batches larger than their queue with indexed configuration diagnostics.
  • Add configuration parity and serialization coverage for Rust, Python, Node.js, and Go while leaving manual subscriber APIs and the C FFI unchanged.
  • Preserve the existing Python OpenTelemetryEndpointConfig positional constructor order by appending the new fields after all pre-existing fields, with regression coverage for legacy positional calls.
  • Document precedence, sizing semantics, queue overflow behavior, scheduled-delay behavior, and the endpoint-local OTLP request timeout.

Validation:

  • uv run pre-commit run --all-files
  • cargo clippy --workspace --all-targets -- -D warnings
  • just test-go
  • just docs
  • Full isolated Python suite: 640 passed, 45 skipped
  • Focused Python observability suite: 16 passed
  • Focused Rust and Node.js observability configuration tests

The canonical Rust, Python, and Node.js commands were also attempted. Configuration-sensitive cases discovered a local /Users/wkillian/.nemo-relay/plugins.toml, producing unrelated inherited-configuration warnings and conflicts. The canonical Python run completed with 629 passing tests and 11 affected tests; the full suite passes when run with isolated configuration discovery.

Where should the reviewer start?

Start with crates/core/src/observability/plugin_component.rs for the public endpoint schema and validation, then crates/core/src/observability/otel.rs for environment-aware batch processor construction and endpoint override precedence. The Python compatibility follow-up is covered by python/tests/test_observability_plugin.py.

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

  • Relates to: RELAY-626

Summary by CodeRabbit

  • New Features

    • Added per-endpoint OpenTelemetry settings for queue size, export batch size, and scheduled export delay.
    • Added support across Rust, Node.js, Go, and Python configuration interfaces.
    • Endpoint-specific settings take precedence over process-wide defaults.
    • Added validation for zero values and batch sizes larger than the queue.
  • Documentation

    • Updated configuration guidance, examples, fallback behavior, and known issues.
  • Tests

    • Added coverage for serialization, validation, defaults, and runtime propagation.

Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07
willkill07 requested review from a team as code owners August 5, 2026 19:56
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

OpenTelemetry endpoints now support optional queue size, export batch size, and scheduled export delay settings. The core provider applies these values through an explicit BatchConfig. Validation, language bindings, tests, and documentation cover the new settings.

Changes

OpenTelemetry batch processor overrides

Layer / File(s) Summary
Runtime batch configuration
crates/core/src/observability/otel.rs, crates/core/tests/unit/observability/otel_tests.rs
OpenTelemetryConfig stores optional batch overrides. Provider construction applies them through an explicit BatchConfig.
Endpoint schema, validation, and wiring
crates/core/src/observability/plugin_component.rs, crates/core/tests/unit/observability/plugin_component_tests.rs
Endpoint schemas expose the settings. Registration propagates them to runtime configuration. Validation rejects zero values and batch sizes larger than queue sizes.
Language binding serialization
crates/node/observability.d.ts, crates/node/tests/*, go/nemo_relay/observability_plugin.*, python/nemo_relay/observability.*, python/tests/*
Node, Go, and Python configurations expose and serialize the new optional settings.
Configuration documentation
docs/about-nemo-relay/release-notes/index.mdx, docs/configure-plugins/observability/*
Documentation describes endpoint settings, validation, fallback precedence, queue sizing, and serial export behavior.

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

Sequence Diagram(s)

sequenceDiagram
  participant Endpoint
  participant OpenTelemetryConfig
  participant BatchSpanProcessor
  Endpoint->>OpenTelemetryConfig: provide queue, batch, and delay overrides
  OpenTelemetryConfig->>OpenTelemetryConfig: validate and build BatchConfig
  OpenTelemetryConfig->>BatchSpanProcessor: construct with BatchConfig
  BatchSpanProcessor->>BatchSpanProcessor: process spans using configured limits
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required Conventional Commits format, describes the endpoint-level OpenTelemetry batching change, and is under 72 characters.
Description check ✅ Passed The description includes all required sections, checkboxes, implementation details, reviewer guidance, related issue information, and validation results.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions github-actions Bot added size:M PR is medium 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 Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@python/nemo_relay/observability.py`:
- Around line 229-231: Preserve positional constructor compatibility for
OpenTelemetryEndpointConfig by moving max_queue_size, max_export_batch_size, and
scheduled_delay_millis after the existing headers, header_env, and
resource_attributes fields, or making the new fields keyword-only. Apply the
matching order and signature update in python/nemo_relay/observability.py at
lines 229-231 and python/nemo_relay/observability.pyi at lines 92-94, and add a
regression test confirming existing positional arguments remain correctly
assigned.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 737a421e-ab23-4445-952e-f050bf7dcc6e

📥 Commits

Reviewing files that changed from the base of the PR and between 0f87ce7 and db3658c.

📒 Files selected for processing (14)
  • crates/core/src/observability/otel.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/tests/unit/observability/otel_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/node/observability.d.ts
  • crates/node/tests/observability_plugin_tests.mjs
  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
  • python/nemo_relay/observability.pyi
  • python/tests/test_observability_plugin.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (45)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

**/*.rs: If any Rust code changed, always run just test-rust.
If any Rust code changed, also run cargo fmt --all.
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings even if relying on pre-commit.

**/*.rs: Format Rust code with rustfmt defaults using cargo fmt.
Run cargo clippy -- -D warnings; all Rust warnings must be treated as errors.
Use Rust snake_case naming conventions.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
{crates/core,crates/adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

Changes to crates/core or crates/adaptive must run the full language matrix

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
crates/core/**/*.rs

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

If the change touched crates/core or shared runtime semantics, also use validate-change for broader validation

Use Result<T> with FlowError in core runtime paths, keeping wrapper-layer errors explicit and binding-appropriate.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

**/*: Use release tags in raw Rust-compatible SemVer without a leading v; tags such as v0.1.0 are prohibited.
Use branch prefixes feat/, fix/, docs/, test/, or refactor/ according to the change purpose.
Every commit in a pull request must include a DCO Signed-off-by: sign-off.
Before submitting a pull request, ensure pre-commit hooks, relevant tests, target-specific builds, documentation updates, and a rebase on the latest main are complete.
Use commit messages in the form type: short description, with a valid type and a first line under 72 characters.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • docs/about-nemo-relay/release-notes/index.mdx
  • python/nemo_relay/observability.pyi
  • python/tests/test_observability_plugin.py
  • crates/node/observability.d.ts
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
  • crates/node/tests/observability_plugin_tests.mjs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
crates/{core,adaptive}/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If crates/core or crates/adaptive changed, run the full validation matrix across Rust, Python, Go, and Node.js.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

**/*.{rs,py,go,js,ts}: When observability configuration or lifecycle is exposed, keep FFI and Python, Go, and Node.js binding-native config objects and subscriber/exporter methods aligned in logical knobs and semantics.
Require every OpenTelemetry endpoint to have a type and nonblank destination; resolve header_env values at activation and reject missing, blank, or duplicate headers.
Concatenate layered ATOF sink, ATIF storage, and OpenTelemetry endpoint lists with higher-precedence entries first.
Preserve correct handling of mark events, start/end events, orphan cases, and span or trajectory fields derived from intended event data.
Run affected Rust tests and just test-rust when event fields change; run just test-python, just test-go, and just test-node when binding-native configuration or lifecycle changes.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • python/tests/test_observability_plugin.py
  • crates/node/observability.d.ts
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

📄 CodeRabbit inference engine (.agents/skills/add-middleware/SKILL.md)

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • python/tests/test_observability_plugin.py
  • crates/node/observability.d.ts
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
**/*.{rs,py,js,jsx,ts,tsx,go,c,h,cc,cpp,md,toml,yml,yaml,sh}

📄 CodeRabbit inference engine (AGENTS.md)

Keep SPDX headers on source, documentation, scripts, and configuration files; the project is Apache-2.0.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • python/tests/test_observability_plugin.py
  • crates/node/observability.d.ts
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case naming in Rust and Python.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • python/tests/test_observability_plugin.py
  • python/nemo_relay/observability.py
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
crates/**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

crates/**/*.rs: Use Json = serde_json::Value in Rust-facing runtime APIs where existing code expects JSON payloads.
Treat Rust as the source of truth for runtime behavior; binding APIs should mirror Rust semantics unless a language-specific wrapper intentionally improves ergonomics.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
**/*.{rs,py,js,mjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Preserve the existing Tokio-based asynchronous model and callback/future lifetimes; do not unexpectedly block or hide async work in bindings.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • python/tests/test_observability_plugin.py
  • crates/node/observability.d.ts
  • python/nemo_relay/observability.py
  • crates/node/tests/observability_plugin_tests.mjs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
**/*.{rs,py,go,js,jsx,ts,tsx,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{rs,py,go,js,jsx,ts,tsx,c,h}: Run tests for every language affected by a change; changes to the core Rust crate require tests across all bindings.
Use SONAR_IGNORE_START / SONAR_IGNORE_END only for documented false positives, keep ignored blocks minimal, explain them with a comment, and obtain reviewer sign-off.
Preserve the layered architecture in which Rust provides the core runtime and C FFI, PyO3, and NAPI provide bindings that mirror the full API surface.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • python/tests/test_observability_plugin.py
  • crates/node/observability.d.ts
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
**/{test,tests}/**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the appropriate test files for each affected language binding.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • python/tests/test_observability_plugin.py
  • crates/node/tests/observability_plugin_tests.mjs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py,go,js,jsx,ts,tsx,c,h,html,md,mdx,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include the appropriate SPDX copyright and Apache-2.0 license header in every source file.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • docs/about-nemo-relay/release-notes/index.mdx
  • python/tests/test_observability_plugin.py
  • crates/node/observability.d.ts
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
crates/{core,adaptive}/**/*.rs

⚙️ CodeRabbit configuration file

crates/{core,adaptive}/**/*.rs: Review the Rust runtime for async correctness, scope isolation, middleware ordering, and event lifecycle regressions.
Pay close attention to task-local/thread-local scope propagation, callback lifetimes, stream finalization, and root_uuid isolation.
Public API changes should preserve existing behavior unless tests and docs show the intended migration path.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • python/tests/test_observability_plugin.py
  • go/nemo_relay/observability_plugin_test.go
  • crates/node/tests/observability_plugin_tests.mjs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

MDX top-of-file SPDX comments must use {/* ... */} delimiters instead of HTML comment delimiters (Must-Fix)

**/*.mdx: In MDX files, top-of-file comments must use JSX comment delimiters ({/* and */}); do not use HTML comments for MDX SPDX headers.
New or regenerated MDX files must use {/* ... */} for top-of-file SPDX comments.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
docs/about-nemo-relay/release-notes/{index,highlights,known-issues}.mdx

📄 CodeRabbit inference engine (.agents/skills/draft-release-notes/SKILL.md)

docs/about-nemo-relay/release-notes/{index,highlights,known-issues}.mdx: Update only docs/about-nemo-relay/release-notes/index.mdx, docs/about-nemo-relay/release-notes/highlights.mdx, and docs/about-nemo-relay/release-notes/known-issues.mdx unless the release changes their route or entry points.
Preserve the existing MDX front matter and the JSX SPDX comment in the release-notes pages.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
{docs,examples}/**/*

📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)

Update docs and examples.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
docs/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If documentation examples or commands under docs/ change, run the targeted docs checks appropriate to the change.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
**/*.{md,mdx}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If links in documentation change, run just docs-linkcheck.

Use documented public APIs and stable wrapper commands in examples and user-facing documentation; do not rely on internal helpers.

**/*.{md,mdx}: Prefer the documented public API over internal shortcuts in documentation and examples.
Keep package names, repository references, and build commands current.
Contribution workflow documentation must require an issue before external contribution pull requests and note that NVIDIA contributors may use a GitHub or Linear issue.
Update entry-point documentation when examples or reading paths change.
Keep release-process and release-notes guidance in maintainer documentation such as RELEASING.md, rather than user-facing documentation pages or CHANGELOG.md.
Use stable user-facing wrappers at the scripts/ root in documentation and examples; reference namespaced helper paths only for internal maintenance documentation.
When detailed dynamic plugin guides exist, keep Rust native plugin examples, Python worker plugin examples, and grpc-v1 protocol details on separate pages.
Dynamic plugin manifests in documentation and examples should use compat.relay = ">=0.5,<1.0" unless deliberately narrower.
Render images, diagrams, tables, and other visual content at representative page widths, ensuring legibility and complete access without clipping; use responsive scaling, reflow, or overflow as appropriate and scope visual styling narrowly.
Dynamic plugin entry pages should link to native, worker, Rust example, Python example, and protocol pages when those pages exist.
Images, diagrams, tables, and custom visual content must remain legible and fully accessible at representative desktop and narrow page widths.
Release-policy documentation must point to GitHub Releases as the only release-history source of truth.
Run just docs when the documentation site changes; retain ./scripts/build-docs.sh html as the compatibility wrapper.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
**/*.{md,mdx,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)

Examples and documentation must use each exporter's documented flush/deregister order before shutdown.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • python/tests/test_observability_plugin.py
  • crates/node/observability.d.ts
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update relevant reference documentation when public behavior or APIs change.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
**/*.{md,mdx,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-technical-docs.md)

**/*.{md,mdx,rst}: Use title case consistently for technical documentation headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title case.
Format code elements, commands, parameters, package names, expressions, directories, file names, and paths in monospace; represent path placeholders with angle brackets inside monospace.
Format UI buttons, menus, fields, and labels in bold, and separate consecutive UI navigation labels with >.
Use quotation marks for error messages and strings when appropriate, italics for newly introduced terms and publication titles, and plain text for keyboard shortcuts.
Represent GitHub repositories with owner/repository link text, such as [NVIDIA/NeMo](link), rather than generic repository wording.
Introduce every code block with a complete sentence; do not let a code block complete or interrupt the grammar of surrounding prose; use syntax highlighting when supported.
Keep inline method, function, and class references consistent with nearby documentation; omit empty parentheses in prose when no call is shown.
Use descriptive link text matching the destination title when possible; avoid raw URLs, generic anchors, long-sentence links, and unnecessary links that distract from procedures.
Ensure lists have a complete lead-in sentence, more than one item, no more than two levels, parallel construction, one idea or action per item, and appropriate punctuation; use bullets for unordered items and numbers for ordered tasks.
Format definition lists with a bold term followed by a complete, parallel, punctuated definition.
Use tables for reference information, decision support, compatibility matrices, and comparable choices; flag one-row tables, missing captions or lead-ins, sentence-case headers where title case is expected, unexplained empty cells, and code or links that would be clearer as prose.
Write procedure steps as imperative ...

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.
Flag stale examples, missing SPDX headers where required, and instructions that no longer match CI or pre-commit behavior.

Files:

  • docs/about-nemo-relay/release-notes/index.mdx
  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
{crates/python/src/py_api/mod.rs,python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go,crates/node/src/api/**/*.rs}

📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Update the language-native bindings for every exposed surface in Python, Go, and Node.js.

Files:

  • python/nemo_relay/observability.pyi
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
{python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go}

📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Update language wrapper helpers such as Python wrapper modules, Python type stubs, and Go shorthand packages when the new behavior belongs in those helper layers.

Files:

  • python/nemo_relay/observability.pyi
  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
  • python/nemo_relay/observability.py
python/nemo_relay/**/*

⚙️ CodeRabbit configuration file

python/nemo_relay/**/*: Review Python wrapper changes for typed API consistency, contextvars-based scope isolation, async behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/nemo_relay/observability.pyi
  • python/nemo_relay/observability.py
{crates/**/src/**/*.rs,python/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not add tests under src; Rust tests belong in crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • python/tests/test_observability_plugin.py
  • python/nemo_relay/observability.py
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
python/tests/**/*.py

📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)

python/tests/**/*.py: Pytest is used to run tests.
Do not add @pytest.mark.asyncio to any test; async tests are automatically detected and run by the async runner.
Do not add a -> None return type annotation to test functions.
When mocking a class, do not define a new class; use unittest.mock.MagicMock or unittest.mock.AsyncMock, with the spec constructor argument when necessary.
Name mocked classes with the mock prefix, not fake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; if a fixture is needed in multiple test files, place it in a conftest.py file.
When creating a fixture, use @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and define the fixture function as def <fixture_name>_fixture() -> <return_type>:; only specify scope when it is not function.
Prefer pytest.mark.parametrize over creating individual tests for different input types.

Maintain test coverage for Python binding and wrapper changes with the Python test suite.

Files:

  • python/tests/test_observability_plugin.py
**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.py: Lint Python with Ruff using rule sets E, F, W, and I.
Format Python with the Ruff formatter, using a 120-character line length and double quotes.
Run ty for Python type checking.
Use Python snake_case naming conventions.

Files:

  • python/tests/test_observability_plugin.py
  • python/nemo_relay/observability.py
crates/node/**/*.{js,ts,jsx,tsx,json}

📄 CodeRabbit inference engine (.agents/skills/test-node-binding/SKILL.md)

Format changed Node files with npm run format --workspace=nemo-relay-node

Files:

  • crates/node/observability.d.ts
crates/node/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.agents/skills/test-node-binding/SKILL.md)

Use npm run check:docstrings --workspace=nemo-relay-node to validate public API docstring checks when surface docs changed

Files:

  • crates/node/observability.d.ts
crates/node/**/*.{js,mjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use camelCase naming for Node.js APIs.

Files:

  • crates/node/observability.d.ts
  • crates/node/tests/observability_plugin_tests.mjs
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use Node.js camelCase naming conventions.

Files:

  • crates/node/observability.d.ts
crates/{python,ffi,node}/**/*

⚙️ CodeRabbit configuration file

crates/{python,ffi,node}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.

Files:

  • crates/node/observability.d.ts
  • crates/node/tests/observability_plugin_tests.mjs
docs/{about-nemo-relay/concepts/subscribers.mdx,configure-plugins/observability/**/*.mdx}

📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)

Update observability documentation and examples alongside implementation changes, including configuration version 3 with one opentelemetry section containing typed endpoints and no standalone public OpenInference surface.

Files:

  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
go/nemo_relay/**/*.go

📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)

go/nemo_relay/**/*.go: Format changed Go packages with cd go/nemo_relay && go fmt ./...
Run Go tests with just test-go to build and test the NeMo Relay Go binding
Use just build-go when you want an explicit build-only pass or need the artifact for other work
Use just ci=true test-go when you need the CI-style coverage and JUnit path
On macOS, set DYLD_LIBRARY_PATH to the ../../target/release directory before running the raw go test command directly

Files:

  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
go/nemo_relay/**

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep shared plugin helpers in go/nemo_relay aligned with plugin registration, composition, and lifecycle behavior.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
go/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

Use PascalCase for public Go APIs.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
**/*.go

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.go: Format Go code with gofmt.
Run go vet ./... for Go static analysis.
Use Go PascalCase naming conventions.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
go/nemo_relay/**/*

⚙️ CodeRabbit configuration file

go/nemo_relay/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.

Files:

  • go/nemo_relay/observability_plugin.go
  • go/nemo_relay/observability_plugin_test.go
python/nemo_relay/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Keep Python wrapper modules under python/nemo_relay/; the native extension is built from crates/python with maturin.

Files:

  • python/nemo_relay/observability.py
**/crates/core/src/observability/{atif,otel,openinference}.rs

📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)

Keep ATIF, OpenTelemetry, and OpenInference observability projections synchronized with the core event model and emitted fields.

Files:

  • crates/core/src/observability/otel.rs
**/crates/core/src/observability/otel.rs

📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)

**/crates/core/src/observability/otel.rs: The gen_ai OpenTelemetry projection must omit nemo_relay.* and content-capture attributes while preserving descendants through omitted scopes.
Derive compliant trace and span IDs consistently across typed OpenTelemetry endpoints while preserving lifecycle parentage.

Files:

  • crates/core/src/observability/otel.rs
🧠 Learnings (7)
📚 Learning: 2026-08-03T19:55:03.931Z
Learnt from: afourniernv
Repo: NVIDIA/NeMo-Relay PR: 558
File: crates/pii-redaction/src/rampart/mod.rs:265-274
Timestamp: 2026-08-03T19:55:03.931Z
Learning: In NeMo Relay first-party plugin registration helpers, treat the documented duplicate-registration `PluginError::RegistrationFailed` result from `register_plugin` as success when registration is intended to be idempotent. Do not locally reclassify this as `PluginError::Conflict`; changing the classification requires a core-wide review of the public API and FFI behavior.

Applied to files:

  • crates/core/tests/unit/observability/otel_tests.rs
  • crates/core/tests/unit/observability/plugin_component_tests.rs
  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
📚 Learning: 2026-05-07T18:04:44.387Z
Learnt from: mnajafian-nv
Repo: NVIDIA/NeMo-Flow PR: 67
File: integrations/openclaw/src/modules.ts:1-2
Timestamp: 2026-05-07T18:04:44.387Z
Learning: In NVIDIA/NeMo-Flow, TypeScript source files should use `//` line comments for SPDX headers (e.g., `// SPDX-FileCopyrightText: ...` and `// SPDX-License-Identifier: ...`) rather than C-style block comments (`/* ... */`). The repo’s copyright checker enforces this mapping, so `//` SPDX headers in `.ts` files should not be flagged as a style violation.

Applied to files:

  • crates/node/observability.d.ts
📚 Learning: 2026-07-14T02:53:55.471Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 414
File: crates/node/observability.d.ts:61-61
Timestamp: 2026-07-14T02:53:55.471Z
Learning: In `crates/node/observability.d.ts` and `crates/node/observability.js`, treat `OtlpConfig`/`otlpConfig` and related helpers as an intentional mirror of the snake_case TOML/plugin configuration schema consumed by `plugin.initialize()`. Do not apply the usual “Node.js public APIs use camelCase” naming review expectation to this plugin-config schema surface. Instead, camelCase review expectations should apply to the native binding surface (e.g., `OpenTelemetrySubscriber`/`OpenInferenceSubscriber` constructors and their `attributeMappings`), which expose camelCase separately.

Applied to files:

  • crates/node/observability.d.ts
📚 Learning: 2026-07-14T02:53:59.997Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 415
File: docs/configure-plugins/observability/opentelemetry.mdx:98-113
Timestamp: 2026-07-14T02:53:59.997Z
Learning: In NeMo-Relay’s OpenTelemetry/OpenInference observability projection docs under docs/configure-plugins/observability/, document the projected-attribute contract as follows: (1) emit scalar top-level `data`/`metadata` fields as typed dotted OTLP attributes (for example, `nemo_relay.start.metadata.tenant`); (2) keep nested objects/arrays as JSON strings at their top-level OTLP attribute (rather than expanding them into nested OTLP attributes); and (3) do not reference the legacy `*_json` payload attributes (e.g., `data_json`, `metadata_json`, `input_json`) because they were intentionally removed as a breaking change.

Applied to files:

  • docs/configure-plugins/observability/configuration.mdx
  • docs/configure-plugins/observability/opentelemetry.mdx
📚 Learning: 2026-07-28T20:33:25.156Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 572
File: go/nemo_relay/adaptive_runtime_test.go:214-238
Timestamp: 2026-07-28T20:33:25.156Z
Learning: When adding/adjusting Go unit tests for `BuildCacheRequestFacts` (request-ID validation and related request parsing), set `CacheRequestFactsInput.Provider` to a valid provider in all tests that are intended to isolate request-ID behavior—because `BuildCacheRequestFacts` does not validate `Provider`. Then add separate test coverage for malformed `AnnotatedRequest` JSON so JSON parsing failures are not conflated with `Provider`-related inputs.

Applied to files:

  • go/nemo_relay/observability_plugin_test.go
📚 Learning: 2026-07-14T02:53:44.529Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 414
File: crates/node/tests/observability_plugin_tests.mjs:34-34
Timestamp: 2026-07-14T02:53:44.529Z
Learning: Do not flag camelCase style violations for keys returned by observability plugin configuration helpers (e.g., `observability.otlpConfig()` and similar helpers like `atofConfig()` / `atifConfig()`) in the Node observability module and its tests. These helpers intentionally return the snake_case plugin configuration schema consumed by `plugin.initialize()` and written/read via TOML. This is distinct from the Node public API / native subscriber options (e.g., fields like `attributeMappings`) which follow the camelCase guideline; only the plugin-config schema helpers should be exempt.

Applied to files:

  • crates/node/tests/observability_plugin_tests.mjs
📚 Learning: 2026-07-28T20:07:29.880Z
Learnt from: willkill07
Repo: NVIDIA/NeMo-Relay PR: 571
File: crates/core/src/api/runtime/state.rs:996-1020
Timestamp: 2026-07-28T20:07:29.880Z
Learning: In NeMo Relay (RELAY-509), sanitizer callback failures must be treated as intentional fail-open behavior. When an event/tool (request/response) or LLM (request/response) sanitizer callback fails, the sanitizer chain should retain and publish the last valid event/payload snapshot (rather than dropping/invalidating the data) and log the failure including callback context (e.g., which sanitizer/callback failed and relevant identifiers). Apply this consistently across all sanitizer chains mentioned in the RELAY-509 documentation/migration guide.

Applied to files:

  • crates/core/src/observability/plugin_component.rs
  • crates/core/src/observability/otel.rs
🔇 Additional comments (16)
crates/node/observability.d.ts (1)

84-86: LGTM!

Also applies to: 119-119

crates/node/tests/observability_plugin_tests.mjs (2)

70-70: LGTM!


39-41: 🗄️ Data Integrity & Integration

No change needed for omitted batch settings. The test supplies 4096, 256, and 750 explicitly. openTelemetryEndpoint does not default these fields, so omitted settings remain absent and can inherit OTEL_BSP_* and SDK defaults.

			> Likely an incorrect or invalid review comment.
go/nemo_relay/observability_plugin.go (1)

42-44: LGTM!

go/nemo_relay/observability_plugin_test.go (1)

74-79: LGTM!

Also applies to: 147-152, 154-168

python/nemo_relay/observability.py (1)

251-253: LGTM!

python/tests/test_observability_plugin.py (1)

103-118: LGTM!

crates/core/src/observability/otel.rs (2)

52-53: 📐 Maintainability & Code Quality

Run Required Core Validation Before Merge.

The supplied validation summary does not establish cargo fmt --all, just test-rust, validate-change, or the required full binding test matrix for this crates/core change. Run and record these checks before merge.

Sources: Coding guidelines, Path instructions


200-223: LGTM!

Also applies to: 301-327, 823-900

crates/core/tests/unit/observability/otel_tests.rs (1)

3430-3433: LGTM!

crates/core/src/observability/plugin_component.rs (2)

209-220: LGTM!

Also applies to: 543-550, 2005-2013, 2298-2300, 2479-2536


2030-2056: 🎯 Functional Correctness

Keep inherited batch-size capping.

BatchConfigBuilder caps max_export_batch_size to the effective queue when one size is inherited. The documented contract permits this behavior, so no activation error is required for this case.

			> Likely an incorrect or invalid review comment.
crates/core/tests/unit/observability/plugin_component_tests.rs (1)

302-310: LGTM!

Also applies to: 465-467, 488-511, 576-578, 603-605, 652-684, 735-760, 930-932, 958-960

docs/about-nemo-relay/release-notes/index.mdx (1)

96-99: LGTM!

docs/configure-plugins/observability/configuration.mdx (1)

101-101: 📐 Maintainability & Code Quality

Run the required documentation checks for this changed reference.

This change updates an internal MDX anchor. Run just docs-linkcheck. Because the documentation site changed, also run just docs before merge.

Source: Coding guidelines

docs/configure-plugins/observability/opentelemetry.mdx (1)

67-69: LGTM!

Also applies to: 96-105, 107-133, 156-159

Comment thread python/nemo_relay/observability.py Outdated
@willkill07 willkill07 self-assigned this Aug 5, 2026
@willkill07 willkill07 added this to the 0.8 milestone Aug 5, 2026

@zhongxuanwang-nv zhongxuanwang-nv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Will! This looks great!!

Comment thread crates/core/src/observability/plugin_component.rs
Comment thread crates/node/observability.d.ts
Comment thread docs/configure-plugins/observability/opentelemetry.mdx
Signed-off-by: Will Killian <wkillian@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
python/tests/test_observability_plugin.py (1)

128-143: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add validation coverage for the new batch fields.

The test covers only valid positive values. Add cases for zero values and for max_export_batch_size larger than max_queue_size. Assert the indexed diagnostics returned by plugin.validate.

As per path instructions, tests for a changed API must cover the promised error paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/tests/test_observability_plugin.py` around lines 128 - 143, Add
validation tests in the observability plugin test cases for zero values of the
new batch fields and for max_export_batch_size exceeding max_queue_size. Call
plugin.validate for each invalid configuration and assert the indexed
diagnostics, while preserving the existing positive-value serialization coverage
around to_dict.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@python/tests/test_observability_plugin.py`:
- Around line 128-143: Add validation tests in the observability plugin test
cases for zero values of the new batch fields and for max_export_batch_size
exceeding max_queue_size. Call plugin.validate for each invalid configuration
and assert the indexed diagnostics, while preserving the existing positive-value
serialization coverage around to_dict.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 0d38b297-d4a1-4d71-92fe-3a7a5f7a38b7

📥 Commits

Reviewing files that changed from the base of the PR and between db3658c and 3146222.

📒 Files selected for processing (3)
  • python/nemo_relay/observability.py
  • python/nemo_relay/observability.pyi
  • python/tests/test_observability_plugin.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (18)
{crates/python/src/py_api/mod.rs,python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go,crates/node/src/api/**/*.rs}

📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Update the language-native bindings for every exposed surface in Python, Go, and Node.js.

Files:

  • python/nemo_relay/observability.py
  • python/nemo_relay/observability.pyi
{python/nemo_relay/**/*.py,python/nemo_relay/**/*.pyi,go/nemo_relay/**/*.go}

📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Update language wrapper helpers such as Python wrapper modules, Python type stubs, and Go shorthand packages when the new behavior belongs in those helper layers.

Files:

  • python/nemo_relay/observability.py
  • python/nemo_relay/observability.pyi
{crates/**/src/**/*.rs,python/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not add tests under src; Rust tests belong in crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

**/*: Use release tags in raw Rust-compatible SemVer without a leading v; tags such as v0.1.0 are prohibited.
Use branch prefixes feat/, fix/, docs/, test/, or refactor/ according to the change purpose.
Every commit in a pull request must include a DCO Signed-off-by: sign-off.
Before submitting a pull request, ensure pre-commit hooks, relevant tests, target-specific builds, documentation updates, and a rebase on the latest main are complete.
Use commit messages in the form type: short description, with a valid type and a first line under 72 characters.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
  • python/nemo_relay/observability.pyi
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

**/*.{rs,py,go,js,ts}: When observability configuration or lifecycle is exposed, keep FFI and Python, Go, and Node.js binding-native config objects and subscriber/exporter methods aligned in logical knobs and semantics.
Require every OpenTelemetry endpoint to have a type and nonblank destination; resolve header_env values at activation and reject missing, blank, or duplicate headers.
Concatenate layered ATOF sink, ATIF storage, and OpenTelemetry endpoint lists with higher-precedence entries first.
Preserve correct handling of mark events, start/end events, orphan cases, and span or trajectory fields derived from intended event data.
Run affected Rust tests and just test-rust when event fields change; run just test-python, just test-go, and just test-node when binding-native configuration or lifecycle changes.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
**/*.{rs,py,js,ts,tsx,go,java,kt,swift}

📄 CodeRabbit inference engine (.agents/skills/add-middleware/SKILL.md)

Add tests covering registration and duplicate names, deregistration and missing names, priority ordering, callback failure policy, scope-local inheritance and cleanup, event payload semantics, immutable mark and scope fields, and parity across affected bindings.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
**/*.{md,mdx,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)

Examples and documentation must use each exporter's documented flush/deregister order before shutdown.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
**/*.{rs,py,js,jsx,ts,tsx,go,c,h,cc,cpp,md,toml,yml,yaml,sh}

📄 CodeRabbit inference engine (AGENTS.md)

Keep SPDX headers on source, documentation, scripts, and configuration files; the project is Apache-2.0.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Use snake_case naming in Rust and Python.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
**/*.{rs,py,js,mjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Preserve the existing Tokio-based asynchronous model and callback/future lifetimes; do not unexpectedly block or hide async work in bindings.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
python/nemo_relay/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Keep Python wrapper modules under python/nemo_relay/; the native extension is built from crates/python with maturin.

Files:

  • python/nemo_relay/observability.py
**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.py: Lint Python with Ruff using rule sets E, F, W, and I.
Format Python with the Ruff formatter, using a 120-character line length and double quotes.
Run ty for Python type checking.
Use Python snake_case naming conventions.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
**/*.{rs,py,go,js,jsx,ts,tsx,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{rs,py,go,js,jsx,ts,tsx,c,h}: Run tests for every language affected by a change; changes to the core Rust crate require tests across all bindings.
Use SONAR_IGNORE_START / SONAR_IGNORE_END only for documented false positives, keep ignored blocks minimal, explain them with a comment, and obtain reviewer sign-off.
Preserve the layered architecture in which Rust provides the core runtime and C FFI, PyO3, and NAPI provide bindings that mirror the full API surface.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
**/*.{rs,py,go,js,jsx,ts,tsx,c,h,html,md,mdx,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Include the appropriate SPDX copyright and Apache-2.0 license header in every source file.

Files:

  • python/nemo_relay/observability.py
  • python/tests/test_observability_plugin.py
python/nemo_relay/**/*

⚙️ CodeRabbit configuration file

python/nemo_relay/**/*: Review Python wrapper changes for typed API consistency, contextvars-based scope isolation, async behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/nemo_relay/observability.py
  • python/nemo_relay/observability.pyi
python/tests/**/*.py

📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)

python/tests/**/*.py: Pytest is used to run tests.
Do not add @pytest.mark.asyncio to any test; async tests are automatically detected and run by the async runner.
Do not add a -> None return type annotation to test functions.
When mocking a class, do not define a new class; use unittest.mock.MagicMock or unittest.mock.AsyncMock, with the spec constructor argument when necessary.
Name mocked classes with the mock prefix, not fake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; if a fixture is needed in multiple test files, place it in a conftest.py file.
When creating a fixture, use @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and define the fixture function as def <fixture_name>_fixture() -> <return_type>:; only specify scope when it is not function.
Prefer pytest.mark.parametrize over creating individual tests for different input types.

Maintain test coverage for Python binding and wrapper changes with the Python test suite.

Files:

  • python/tests/test_observability_plugin.py
**/{test,tests}/**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the appropriate test files for each affected language binding.

Files:

  • python/tests/test_observability_plugin.py
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • python/tests/test_observability_plugin.py
🔇 Additional comments (2)
python/nemo_relay/observability.py (1)

232-234: LGTM!

Also applies to: 251-253

python/nemo_relay/observability.pyi (1)

95-97: LGTM!

@willkill07

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit 2b2d4d8 into NVIDIA:main Aug 5, 2026
80 checks passed
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:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants