Skip to content

Conversation

@dbnl-renaud
Copy link
Contributor

@dbnl-renaud dbnl-renaud commented Oct 24, 2025

Description

Add support for exporting telemetry to DBNL.

Closes #1107

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
    • Any contribution which contains commits that are not Signed-Off will not be accepted.
  • When the PR is ready for review, new or existing tests cover these changes.
  • When the PR is ready for review, the documentation is up to date with these changes.

Summary by CodeRabbit

  • New Features

    • Added DBNL telemetry exporter to enable tracing and observability integration.
  • Documentation

    • Added a DBNL integration guide, new observability workflow page, and updated provider/integrations lists and table of contents to include DBNL.
  • Examples

    • Added DBNL configuration and a sample observability tutorial showing installation, credential setup, and how to analyze traces.

@dbnl-renaud dbnl-renaud requested a review from a team as a code owner October 24, 2025 19:08
@copy-pr-bot
Copy link

copy-pr-bot bot commented Oct 24, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2025

Walkthrough

Adds DBNL telemetry exporter and docs: a new DBNLTelemetryExporter config and registration that builds an OTLP exporter with DBNL-specific endpoint and headers, example config and README updates, and new observability workflow docs showing how to enable DBNL tracing.

Changes

Cohort / File(s) Summary
Core DBNL exporter implementation
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
Adds public DBNLTelemetryExporter config (api_url, api_token, project_id) and registers dbnl_telemetry_exporter(config, builder): validates inputs, constructs an OTLPSpanAdapterExporter targeting DBNL (appends /otel/v1/traces), injects Authorization: Bearer <token> and x-dbnl-project-id headers, and forwards batch/shutdown parameters.
Example configuration
examples/observability/simple_calculator_observability/configs/config-dbnl.yml
New YAML enabling logging and tracing with dbnl exporter, defines function groups, functions, LLM, and a react-agent workflow referencing DBNL via env vars or explicit fields.
Example README update
examples/observability/simple_calculator_observability/README.md
Adds DBNL integration tutorial: install DBNL, create project/credentials, set DBNL_API_URL, DBNL_API_TOKEN, DBNL_PROJECT_ID, includes config-dbnl.yml, and run/analyze trace instructions.
Docs: exporters & workflows index
docs/source/extend/telemetry-exporters.md, docs/source/workflows/observe/index.md
Adds DBNL to OpenTelemetry exporters list, pre-built integrations, observability providers table (Logging, Tracing), and a ToC entry linking the DBNL workflow doc.
Docs: DBNL workflow guide
docs/source/workflows/observe/observe-workflow-with-dbnl.md
New guide covering DBNL installation, required env vars (DBNL_API_URL, DBNL_API_TOKEN, DBNL_PROJECT_ID), telemetry extras install, workflow configuration for DBNL tracing, running the example, and viewing traces in DBNL.

Sequence Diagram(s)

sequenceDiagram
    participant WF as NeMo Workflow
    participant Exporter as DBNL Exporter (registered)
    participant OTLP as OTLPSpanAdapterExporter
    participant DBNL as DBNL Backend

    WF->>Exporter: emit span(s)
    Exporter->>OTLP: forward spans + endpoint & batch params
    Note right of OTLP #f2f4f8: Inject headers:\nAuthorization: Bearer <token>\nx-dbnl-project-id: <id>
    OTLP->>DBNL: POST /otel/v1/traces (batched)
    DBNL-->>OTLP: 200 / ACK
    OTLP-->>Exporter: success
    Exporter-->>WF: export complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Potential review focus:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py: validation logic, env-var precedence, endpoint concatenation (trailing slash handling), header formatting and error messages.
  • Ensure batch/shutdown parameter passthrough (batch_size, flush_interval, max_queue_size, drop_on_overflow, shutdown_timeout) maps correctly to OTLPSpanAdapterExporter.
  • Examples/docs: confirm env var names and example commands match implementation and are up to date.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Add DBNL Telemetry Exporter" meets all specified requirements. It is concise at 27 characters (well under the 72-character limit), uses imperative mood with the verb "Add," and is highly descriptive of the primary change. The title accurately summarizes the main objective of adding DBNL as a new telemetry exporter to the codebase, which is reflected across all the changes including the new DBNLTelemetryExporter class implementation and supporting documentation and examples.
Linked Issues Check ✅ Passed The pull request fully satisfies the requirement specified in linked issue #1107 to "enable exporting telemetry to DBNL using the nat[opentelemetry] package." The core implementation in packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py adds the public DBNLTelemetryExporter class with necessary fields (api_url, api_token, project_id) and a dbnl_telemetry_exporter registration function that constructs an OTLPSpanAdapterExporter with proper configuration and validation. Supporting changes including documentation updates, workflow guides, and configuration examples provide complete coverage of the requested feature.
Out of Scope Changes Check ✅ Passed All changes in the pull request are directly within scope of the stated objective to add DBNL telemetry exporter support. The modifications span three categories—core implementation (register.py with DBNLTelemetryExporter), documentation (telemetry-exporters.md, observe/index.md, observe-workflow-with-dbnl.md), and examples (config-dbnl.yml and README updates)—all of which directly support the feature addition. No unrelated, incidental, or tangential changes were introduced outside the scope of implementing and documenting the DBNL exporter functionality.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a00c040 and 61893fc.

📒 Files selected for processing (1)
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
{docs/source/**/*.md,**/README.@(md|ipynb)}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{docs/source/**/*.md,**/README.@(md|ipynb)}: Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)
Do not use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq) in documentation unless explicitly referring to deprecated names
Never use “NAT”/“nat” abbreviations in documentation
Documentation must be clear/comprehensive; avoid TODOs/FIXMEs/placeholders; avoid offensive/outdated terms; ensure spelling is correct

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
docs/source/**/*.md

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

docs/source/**/*.md: Documentation sources are Markdown files under docs/source
Surround code entities with backticks in docs to avoid Vale false positives
Do not use words listed in ci/vale/styles/config/vocabularies/nat/reject.txt; accepted words in accept.txt are allowed

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
**/*

⚙️ CodeRabbit configuration file

**/*: # Code Review Instructions

  • Ensure the code follows best practices and coding standards. - For Python code, follow
    PEP 20 and
    PEP 8 for style guidelines.
  • Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
    Example:
    def my_function(param1: int, param2: str) -> bool:
        pass
  • For Python exception handling, ensure proper stack trace preservation:
    • When re-raising exceptions: use bare raise statements to maintain the original stack trace,
      and use logger.error() (not logger.exception()) to avoid duplicate stack trace output.
    • When catching and logging exceptions without re-raising: always use logger.exception()
      to capture the full stack trace information.

Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any

words listed in the ci/vale/styles/config/vocabularies/nat/reject.txt file, words that might appear to be
spelling mistakes but are listed in the ci/vale/styles/config/vocabularies/nat/accept.txt file are OK.

Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,

and should contain an Apache License 2.0 header comment at the top of each file.

  • Confirm that copyright years are up-to date whenever a file is changed.

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
docs/source/**/*

⚙️ CodeRabbit configuration file

This directory contains the source code for the documentation. All documentation should be written in Markdown format. Any image files should be placed in the docs/source/_static directory.

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
🪛 markdownlint-cli2 (0.18.1)
docs/source/workflows/observe/observe-workflow-with-dbnl.md

93-93: Bare URL used

(MD034, no-bare-urls)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 71a7854 and d026fc1.

📒 Files selected for processing (6)
  • docs/source/extend/telemetry-exporters.md (3 hunks)
  • docs/source/workflows/observe/index.md (3 hunks)
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md (1 hunks)
  • examples/observability/simple_calculator_observability/README.md (2 hunks)
  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml (1 hunks)
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
{docs/source/**/*.md,**/README.@(md|ipynb)}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{docs/source/**/*.md,**/README.@(md|ipynb)}: Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)
Do not use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq) in documentation unless explicitly referring to deprecated names
Never use “NAT”/“nat” abbreviations in documentation
Documentation must be clear/comprehensive; avoid TODOs/FIXMEs/placeholders; avoid offensive/outdated terms; ensure spelling is correct

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
  • docs/source/extend/telemetry-exporters.md
  • docs/source/workflows/observe/index.md
  • examples/observability/simple_calculator_observability/README.md
docs/source/**/*.md

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

docs/source/**/*.md: Documentation sources are Markdown files under docs/source
Surround code entities with backticks in docs to avoid Vale false positives
Do not use words listed in ci/vale/styles/config/vocabularies/nat/reject.txt; accepted words in accept.txt are allowed

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
  • docs/source/extend/telemetry-exporters.md
  • docs/source/workflows/observe/index.md
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
  • docs/source/extend/telemetry-exporters.md
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
  • docs/source/workflows/observe/index.md
  • examples/observability/simple_calculator_observability/README.md
**/*

⚙️ CodeRabbit configuration file

**/*: # Code Review Instructions

  • Ensure the code follows best practices and coding standards. - For Python code, follow
    PEP 20 and
    PEP 8 for style guidelines.
  • Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
    Example:
    def my_function(param1: int, param2: str) -> bool:
        pass
  • For Python exception handling, ensure proper stack trace preservation:
    • When re-raising exceptions: use bare raise statements to maintain the original stack trace,
      and use logger.error() (not logger.exception()) to avoid duplicate stack trace output.
    • When catching and logging exceptions without re-raising: always use logger.exception()
      to capture the full stack trace information.

Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any

words listed in the ci/vale/styles/config/vocabularies/nat/reject.txt file, words that might appear to be
spelling mistakes but are listed in the ci/vale/styles/config/vocabularies/nat/accept.txt file are OK.

Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,

and should contain an Apache License 2.0 header comment at the top of each file.

  • Confirm that copyright years are up-to date whenever a file is changed.

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
  • docs/source/extend/telemetry-exporters.md
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
  • docs/source/workflows/observe/index.md
  • examples/observability/simple_calculator_observability/README.md
docs/source/**/*

⚙️ CodeRabbit configuration file

This directory contains the source code for the documentation. All documentation should be written in Markdown format. Any image files should be placed in the docs/source/_static directory.

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
  • docs/source/extend/telemetry-exporters.md
  • docs/source/workflows/observe/index.md
**/configs/**

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Configuration files consumed by code should be stored next to that code in a configs/ folder

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
examples/**/*

⚙️ CodeRabbit configuration file

examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.

  • If an example contains Python code, it should be placed in a subdirectory named src/ and should
    contain a pyproject.toml file. Optionally, it might also contain scripts in a scripts/ directory.
  • If an example contains YAML files, they should be placed in a subdirectory named configs/. - If an example contains sample data files, they should be placed in a subdirectory named data/, and should
    be checked into git-lfs.

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
  • examples/observability/simple_calculator_observability/README.md
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.py: In code comments use the abbreviations: nat (API namespace/CLI), nvidia-nat (package), NAT (env var prefixes); never use these abbreviations in documentation
Follow PEP 20 and PEP 8 for Python style
Run yapf with column_limit=120; yapf is used for formatting (run second)
Indent with 4 spaces (no tabs) and end each file with a single trailing newline
Use ruff (ruff check --fix) as a linter (not formatter) per pyproject.toml; fix warnings unless explicitly ignored
Respect Python naming schemes: snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
When re-raising exceptions, use bare raise to preserve stack trace; log with logger.error(), not logger.exception()
When catching and logging without re-raising, use logger.exception() to capture full stack trace
Provide Google-style docstrings for every public module, class, function, and CLI command
Docstring first line must be a concise description ending with a period
Validate and sanitize all user input, especially in web or CLI interfaces
Prefer httpx with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use async/await for I/O-bound work (HTTP, DB, file I/O)
Cache expensive computations with functools.lru_cache or an external cache when appropriate
Leverage NumPy vectorized operations when beneficial and feasible

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
{src/**/*.py,packages/*/src/**/*.py}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{src/**/*.py,packages/*/src/**/*.py}: All importable Python code must live under src/ or packages//src/
All public APIs must have Python 3.11+ type hints on parameters and return values
Prefer typing/collections.abc abstractions (e.g., Sequence over list)
Use typing.Annotated for units or metadata when useful
Treat pyright warnings as errors during development

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/*/src/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

If a package contains Python code, it must have tests in a tests/ directory at the same level as pyproject.toml

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/**/*

⚙️ CodeRabbit configuration file

packages/**/*: - This directory contains optional plugin packages for the toolkit, each should contain a pyproject.toml file. - The pyproject.toml file should declare a dependency on nvidia-nat or another package with a name starting
with nvidia-nat-. This dependency should be declared using ~=<version>, and the version should be a two
digit version (ex: ~=1.0).

  • Not all packages contain Python code, if they do they should also contain their own set of tests, in a
    tests/ directory at the same level as the pyproject.toml file.

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
🧬 Code graph analysis (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (3)
tests/nat/data_models/test_common.py (1)
  • BatchConfigMixin (158-159)
src/nat/cli/type_registry.py (1)
  • register_telemetry_exporter (412-420)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.py (1)
  • OTLPSpanAdapterExporter (25-94)
🪛 LanguageTool
examples/observability/simple_calculator_observability/README.md

[grammar] ~256-~256: Ensure spelling is correct
Context: ...ps://www.distributional.com/) helps you undestand your agent by analyzing your traces. 1...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 markdownlint-cli2 (0.18.1)
docs/source/workflows/observe/observe-workflow-with-dbnl.md

33-33: Bare URL used

(MD034, no-bare-urls)


97-97: Bare URL used

(MD034, no-bare-urls)

🪛 Ruff (0.14.1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py

206-206: Unused function argument: builder

(ARG001)

🔇 Additional comments (5)
docs/source/workflows/observe/index.md (1)

145-145: LGTM! Consistent documentation updates.

The DBNL references are properly integrated into the observability documentation, following the established patterns for other telemetry exporters.

Also applies to: 163-163, 212-212

examples/observability/simple_calculator_observability/README.md (1)

254-283: LGTM! Well-structured DBNL integration tutorial.

The DBNL section follows the established pattern of other observability platform integrations and provides clear setup instructions.

docs/source/workflows/observe/observe-workflow-with-dbnl.md (1)

1-100: LGTM! Comprehensive DBNL workflow guide.

The workflow guide provides clear, step-by-step instructions for integrating DBNL observability, consistent with other platform guides in the documentation.

docs/source/extend/telemetry-exporters.md (1)

248-248: LGTM! Consistent DBNL integration documentation.

The DBNL exporter is properly documented alongside other pre-built integrations with correct installation and configuration details.

Also applies to: 282-282

examples/observability/simple_calculator_observability/configs/config-dbnl.yml (1)

28-32: LGTM! Proper configuration pattern.

The DBNL tracing configuration correctly uses commented-out fields to encourage environment variable usage for sensitive credentials (API token and project ID), following security best practices.

@willkill07 willkill07 changed the title Renaud eng 3090 Add DBNL Telemetry Exporter Oct 24, 2025
@willkill07 willkill07 added non-breaking Non-breaking change feature request New feature or request labels Oct 24, 2025
@willkill07
Copy link
Member

@dbnl-renaud The Contributing Guidelines require that all contributors must sign-off their commits.

We also have a CI pipeline that only runs once triggered by a team member. I would appreciate if you could address the first round of feedback before I kick off a CI run.

Copy link
Contributor Author

@dbnl-renaud dbnl-renaud left a comment

Choose a reason for hiding this comment

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

Fixed comments. PTAL.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1)

205-226: Add validation for credentials to prevent silent failures.

The function uses config.api_token and config.project_id directly without validating they are non-empty. Even though these fields are required in the config class, users can explicitly pass empty strings, which will cause the exporter to silently fail or send invalid requests.

Following the pattern from langfuse_telemetry_exporter (lines 49-50), langsmith_telemetry_exporter (lines 84-85), and patronus_telemetry_exporter (lines 149-150), add validation and environment variable fallback:

     from nat.plugins.opentelemetry import OTLPSpanAdapterExporter

+    api_token = config.api_token or os.environ.get("DBNL_API_TOKEN")
+    project_id = config.project_id or os.environ.get("DBNL_PROJECT_ID")
+    if not api_token or not project_id:
+        raise ValueError("API token and project ID are required for DBNL")
+
     headers = {
-        "Authorization": f"Bearer {config.api_token}",
-        "x-dbnl-project-id": config.project_id,
+        "Authorization": f"Bearer {api_token}",
+        "x-dbnl-project-id": project_id,
     }

This addresses the validation concern raised in the past review and adds environment variable support for better user experience.

🧹 Nitpick comments (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1)

197-203: Consider adding default values for environment variable fallback.

The api_token and project_id fields are required (no default values), which differs from the pattern used in langfuse_telemetry_exporter (lines 34-35), langsmith_telemetry_exporter (line 72), and patronus_telemetry_exporter (line 137), where credentials have default="" and support environment variable fallback in the exporter function.

For consistency and user convenience, consider following the same pattern:

-    api_token: str = Field(description="The DBNL API token.")
-    project_id: str = Field(description="The DBNL project id.")
+    api_token: str = Field(description="The DBNL API token.", default="")
+    project_id: str = Field(description="The DBNL project id.", default="")

Then add environment variable support in the exporter function (see next comment).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b99550 and 1db6fc6.

📒 Files selected for processing (1)
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.py: In code comments use the abbreviations: nat (API namespace/CLI), nvidia-nat (package), NAT (env var prefixes); never use these abbreviations in documentation
Follow PEP 20 and PEP 8 for Python style
Run yapf with column_limit=120; yapf is used for formatting (run second)
Indent with 4 spaces (no tabs) and end each file with a single trailing newline
Use ruff (ruff check --fix) as a linter (not formatter) per pyproject.toml; fix warnings unless explicitly ignored
Respect Python naming schemes: snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
When re-raising exceptions, use bare raise to preserve stack trace; log with logger.error(), not logger.exception()
When catching and logging without re-raising, use logger.exception() to capture full stack trace
Provide Google-style docstrings for every public module, class, function, and CLI command
Docstring first line must be a concise description ending with a period
Validate and sanitize all user input, especially in web or CLI interfaces
Prefer httpx with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use async/await for I/O-bound work (HTTP, DB, file I/O)
Cache expensive computations with functools.lru_cache or an external cache when appropriate
Leverage NumPy vectorized operations when beneficial and feasible

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
{src/**/*.py,packages/*/src/**/*.py}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{src/**/*.py,packages/*/src/**/*.py}: All importable Python code must live under src/ or packages//src/
All public APIs must have Python 3.11+ type hints on parameters and return values
Prefer typing/collections.abc abstractions (e.g., Sequence over list)
Use typing.Annotated for units or metadata when useful
Treat pyright warnings as errors during development

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/*/src/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

If a package contains Python code, it must have tests in a tests/ directory at the same level as pyproject.toml

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
**/*

⚙️ CodeRabbit configuration file

**/*: # Code Review Instructions

  • Ensure the code follows best practices and coding standards. - For Python code, follow
    PEP 20 and
    PEP 8 for style guidelines.
  • Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
    Example:
    def my_function(param1: int, param2: str) -> bool:
        pass
  • For Python exception handling, ensure proper stack trace preservation:
    • When re-raising exceptions: use bare raise statements to maintain the original stack trace,
      and use logger.error() (not logger.exception()) to avoid duplicate stack trace output.
    • When catching and logging exceptions without re-raising: always use logger.exception()
      to capture the full stack trace information.

Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any

words listed in the ci/vale/styles/config/vocabularies/nat/reject.txt file, words that might appear to be
spelling mistakes but are listed in the ci/vale/styles/config/vocabularies/nat/accept.txt file are OK.

Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,

and should contain an Apache License 2.0 header comment at the top of each file.

  • Confirm that copyright years are up-to date whenever a file is changed.

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/**/*

⚙️ CodeRabbit configuration file

packages/**/*: - This directory contains optional plugin packages for the toolkit, each should contain a pyproject.toml file. - The pyproject.toml file should declare a dependency on nvidia-nat or another package with a name starting
with nvidia-nat-. This dependency should be declared using ~=<version>, and the version should be a two
digit version (ex: ~=1.0).

  • Not all packages contain Python code, if they do they should also contain their own set of tests, in a
    tests/ directory at the same level as the pyproject.toml file.

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
🧬 Code graph analysis (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (3)
tests/nat/data_models/test_common.py (1)
  • BatchConfigMixin (158-159)
src/nat/cli/type_registry.py (1)
  • register_telemetry_exporter (412-420)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.py (1)
  • OTLPSpanAdapterExporter (25-94)
🪛 Ruff (0.14.1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py

206-206: Unused function argument: builder

(ARG001)

Copy link
Contributor Author

@dbnl-renaud dbnl-renaud left a comment

Choose a reason for hiding this comment

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

I originally misread that commits needed to be signed. I amended all the commits to include a signoff on each.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
docs/source/workflows/observe/observe-workflow-with-dbnl.md (1)

96-96: Wrap bare URL in angle brackets.

The bare URL should be enclosed in angle brackets for proper markdown rendering and better accessibility, consistent with line 33.

Apply this diff:

-1. Navigate to your DBNL deployment (e.g. http://localhost:8080/)
+1. Navigate to your DBNL deployment (e.g. <http://localhost:8080/>)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1)

211-214: Add environment variable fallback and credential validation.

The exporter directly uses config.api_token and config.project_id without fallback to environment variables or validation. This is inconsistent with other exporters in this file (langfuse, langsmith, patronus) which follow a pattern of environment variable fallback and validation.

Following the pattern established by langfuse_telemetry_exporter (lines 47-50) and langsmith_telemetry_exporter (lines 83-85), apply this diff:

+    api_token = config.api_token or os.environ.get("DBNL_API_TOKEN")
+    project_id = config.project_id or os.environ.get("DBNL_PROJECT_ID")
+    if not api_token or not project_id:
+        raise ValueError("API token and project ID are required for DBNL")
+
     headers = {
-        "Authorization": f"Bearer {config.api_token}",
-        "x-dbnl-project-id": config.project_id,
+        "Authorization": f"Bearer {api_token}",
+        "x-dbnl-project-id": project_id,
     }
🧹 Nitpick comments (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1)

201-202: Consider adding default empty strings for consistency.

For consistency with other exporters like LangfuseTelemetryExporter (lines 34-35) and LangsmithTelemetryExporter (line 72), consider adding default="" to the api_token and project_id fields. This allows users to rely on environment variables without explicitly setting empty values in config.

Apply this diff:

-    api_token: str = Field(description="The DBNL API token.")
-    project_id: str = Field(description="The DBNL project id.")
+    api_token: str = Field(description="The DBNL API token.", default="")
+    project_id: str = Field(description="The DBNL project id.", default="")
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1db6fc6 and 2670e06.

📒 Files selected for processing (6)
  • docs/source/extend/telemetry-exporters.md (3 hunks)
  • docs/source/workflows/observe/index.md (3 hunks)
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md (1 hunks)
  • examples/observability/simple_calculator_observability/README.md (2 hunks)
  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml (1 hunks)
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/source/extend/telemetry-exporters.md
  • examples/observability/simple_calculator_observability/README.md
🧰 Additional context used
📓 Path-based instructions (11)
**/configs/**

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Configuration files consumed by code should be stored next to that code in a configs/ folder

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
  • docs/source/workflows/observe/index.md
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
**/*

⚙️ CodeRabbit configuration file

**/*: # Code Review Instructions

  • Ensure the code follows best practices and coding standards. - For Python code, follow
    PEP 20 and
    PEP 8 for style guidelines.
  • Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
    Example:
    def my_function(param1: int, param2: str) -> bool:
        pass
  • For Python exception handling, ensure proper stack trace preservation:
    • When re-raising exceptions: use bare raise statements to maintain the original stack trace,
      and use logger.error() (not logger.exception()) to avoid duplicate stack trace output.
    • When catching and logging exceptions without re-raising: always use logger.exception()
      to capture the full stack trace information.

Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any

words listed in the ci/vale/styles/config/vocabularies/nat/reject.txt file, words that might appear to be
spelling mistakes but are listed in the ci/vale/styles/config/vocabularies/nat/accept.txt file are OK.

Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,

and should contain an Apache License 2.0 header comment at the top of each file.

  • Confirm that copyright years are up-to date whenever a file is changed.

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
  • docs/source/workflows/observe/index.md
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
examples/**/*

⚙️ CodeRabbit configuration file

examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.

  • If an example contains Python code, it should be placed in a subdirectory named src/ and should
    contain a pyproject.toml file. Optionally, it might also contain scripts in a scripts/ directory.
  • If an example contains YAML files, they should be placed in a subdirectory named configs/. - If an example contains sample data files, they should be placed in a subdirectory named data/, and should
    be checked into git-lfs.

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
{docs/source/**/*.md,**/README.@(md|ipynb)}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{docs/source/**/*.md,**/README.@(md|ipynb)}: Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)
Do not use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq) in documentation unless explicitly referring to deprecated names
Never use “NAT”/“nat” abbreviations in documentation
Documentation must be clear/comprehensive; avoid TODOs/FIXMEs/placeholders; avoid offensive/outdated terms; ensure spelling is correct

Files:

  • docs/source/workflows/observe/index.md
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
docs/source/**/*.md

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

docs/source/**/*.md: Documentation sources are Markdown files under docs/source
Surround code entities with backticks in docs to avoid Vale false positives
Do not use words listed in ci/vale/styles/config/vocabularies/nat/reject.txt; accepted words in accept.txt are allowed

Files:

  • docs/source/workflows/observe/index.md
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
docs/source/**/*

⚙️ CodeRabbit configuration file

This directory contains the source code for the documentation. All documentation should be written in Markdown format. Any image files should be placed in the docs/source/_static directory.

Files:

  • docs/source/workflows/observe/index.md
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.py: In code comments use the abbreviations: nat (API namespace/CLI), nvidia-nat (package), NAT (env var prefixes); never use these abbreviations in documentation
Follow PEP 20 and PEP 8 for Python style
Run yapf with column_limit=120; yapf is used for formatting (run second)
Indent with 4 spaces (no tabs) and end each file with a single trailing newline
Use ruff (ruff check --fix) as a linter (not formatter) per pyproject.toml; fix warnings unless explicitly ignored
Respect Python naming schemes: snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
When re-raising exceptions, use bare raise to preserve stack trace; log with logger.error(), not logger.exception()
When catching and logging without re-raising, use logger.exception() to capture full stack trace
Provide Google-style docstrings for every public module, class, function, and CLI command
Docstring first line must be a concise description ending with a period
Validate and sanitize all user input, especially in web or CLI interfaces
Prefer httpx with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use async/await for I/O-bound work (HTTP, DB, file I/O)
Cache expensive computations with functools.lru_cache or an external cache when appropriate
Leverage NumPy vectorized operations when beneficial and feasible

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
{src/**/*.py,packages/*/src/**/*.py}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{src/**/*.py,packages/*/src/**/*.py}: All importable Python code must live under src/ or packages//src/
All public APIs must have Python 3.11+ type hints on parameters and return values
Prefer typing/collections.abc abstractions (e.g., Sequence over list)
Use typing.Annotated for units or metadata when useful
Treat pyright warnings as errors during development

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/*/src/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

If a package contains Python code, it must have tests in a tests/ directory at the same level as pyproject.toml

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/**/*

⚙️ CodeRabbit configuration file

packages/**/*: - This directory contains optional plugin packages for the toolkit, each should contain a pyproject.toml file. - The pyproject.toml file should declare a dependency on nvidia-nat or another package with a name starting
with nvidia-nat-. This dependency should be declared using ~=<version>, and the version should be a two
digit version (ex: ~=1.0).

  • Not all packages contain Python code, if they do they should also contain their own set of tests, in a
    tests/ directory at the same level as the pyproject.toml file.

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
🧬 Code graph analysis (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (4)
tests/nat/data_models/test_common.py (1)
  • BatchConfigMixin (158-159)
src/nat/cli/type_registry.py (1)
  • register_telemetry_exporter (412-420)
src/nat/builder/builder.py (1)
  • Builder (68-290)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.py (1)
  • OTLPSpanAdapterExporter (25-94)
🪛 markdownlint-cli2 (0.18.1)
docs/source/workflows/observe/observe-workflow-with-dbnl.md

30-30: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

🪛 Ruff (0.14.1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py

206-206: Unused function argument: builder

(ARG001)

@willkill07
Copy link
Member

/ok to test 2670e06

@willkill07
Copy link
Member

/ok to test 2670e06

Copy link
Member

@willkill07 willkill07 left a comment

Choose a reason for hiding this comment

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

Approving with minor changes required for the workflow due to merged changes to develop

Signed-off-by: Renaud Bourassa <[email protected]>
Signed-off-by: Renaud Bourassa <[email protected]>
Signed-off-by: Renaud Bourassa <[email protected]>
Signed-off-by: Renaud Bourassa <[email protected]>
Signed-off-by: Renaud Bourassa <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (2)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1)

198-204: Provide a sensible default for api_url.

Match prior feedback and enable near zero‑config local runs.

-class DBNLTelemetryExporter(BatchConfigMixin, TelemetryExporterBaseConfig, name="dbnl"):
+class DBNLTelemetryExporter(BatchConfigMixin, TelemetryExporterBaseConfig, name="dbnl"):
@@
-    api_url: str | None = Field(description="The DBNL API url.", default=None)
+    api_url: str | None = Field(
+        description="The DBNL OTEL traces API URL.",
+        default="http://localhost:8080/api"
+    )
docs/source/workflows/observe/observe-workflow-with-dbnl.md (1)

93-96: Wrap bare URL in angle brackets.

Complies with MD034 and improves rendering.

-1. Navigate to your DBNL deployment (e.g. http://localhost:8080/)
+1. Navigate to your DBNL deployment (e.g. <http://localhost:8080/>)
🧹 Nitpick comments (4)
docs/source/workflows/observe/observe-workflow-with-dbnl.md (3)

20-24: Use full product name on first mention.

Replace the first mention with “NVIDIA NeMo Agent toolkit”; subsequent mentions can use “NeMo Agent toolkit”.

-This guide provides a step-by-step process to enable observability in a NeMo Agent toolkit workflow using DBNL for tracing. By the end of this guide, you will have:
+This guide provides a step-by-step process to enable observability in an NVIDIA NeMo Agent toolkit workflow using DBNL for tracing. By the end of this guide, you will have:

52-57: Fix branding capitalization in headings (“Toolkit”).

Headings should use “NeMo Agent Toolkit”.

-## Step 4: Install the NeMo Agent toolkit OpenTelemetry Subpackages
+## Step 4: Install the NeMo Agent Toolkit OpenTelemetry Subpackages
-## Step 5: Modify NeMo Agent toolkit Workflow Configuration
+## Step 5: Modify NeMo Agent Toolkit Workflow Configuration

Also applies to: 59-61


33-40: Terminology nit: “Project ID” capitalization.

Use “ID” (all caps) for consistency.

-7. Note down the **Project Id** for the project
+7. Note down the **Project ID** for the project
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1)

212-218: Resolve TRY003 lint on ValueError messages.

Either shorten messages or add inline ignores to keep style consistent with the rest of this file.

-    if not api_token:
-        raise ValueError("API token is required for DBNL")
+    if not api_token:
+        raise ValueError("API token is required for DBNL")  # noqa: TRY003
@@
-    if not project_id:
-        raise ValueError("Project id is required for DBNL")
+    if not project_id:
+        raise ValueError("Project id is required for DBNL")  # noqa: TRY003
@@
-    if not api_url:
-        raise ValueError("API url is required for DBNL")
+    if not api_url:
+        raise ValueError("API url is required for DBNL")  # noqa: TRY003

Also applies to: 224-228

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2670e06 and 7ea5730.

📒 Files selected for processing (6)
  • docs/source/extend/telemetry-exporters.md (3 hunks)
  • docs/source/workflows/observe/index.md (3 hunks)
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md (1 hunks)
  • examples/observability/simple_calculator_observability/README.md (2 hunks)
  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml (1 hunks)
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • examples/observability/simple_calculator_observability/README.md
  • docs/source/extend/telemetry-exporters.md
🧰 Additional context used
📓 Path-based instructions (11)
**/configs/**

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Configuration files consumed by code should be stored next to that code in a configs/ folder

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
  • docs/source/workflows/observe/index.md
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
**/*

⚙️ CodeRabbit configuration file

**/*: # Code Review Instructions

  • Ensure the code follows best practices and coding standards. - For Python code, follow
    PEP 20 and
    PEP 8 for style guidelines.
  • Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
    Example:
    def my_function(param1: int, param2: str) -> bool:
        pass
  • For Python exception handling, ensure proper stack trace preservation:
    • When re-raising exceptions: use bare raise statements to maintain the original stack trace,
      and use logger.error() (not logger.exception()) to avoid duplicate stack trace output.
    • When catching and logging exceptions without re-raising: always use logger.exception()
      to capture the full stack trace information.

Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any

words listed in the ci/vale/styles/config/vocabularies/nat/reject.txt file, words that might appear to be
spelling mistakes but are listed in the ci/vale/styles/config/vocabularies/nat/accept.txt file are OK.

Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,

and should contain an Apache License 2.0 header comment at the top of each file.

  • Confirm that copyright years are up-to date whenever a file is changed.

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
  • docs/source/workflows/observe/index.md
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
examples/**/*

⚙️ CodeRabbit configuration file

examples/**/*: - This directory contains example code and usage scenarios for the toolkit, at a minimum an example should
contain a README.md or file README.ipynb.

  • If an example contains Python code, it should be placed in a subdirectory named src/ and should
    contain a pyproject.toml file. Optionally, it might also contain scripts in a scripts/ directory.
  • If an example contains YAML files, they should be placed in a subdirectory named configs/. - If an example contains sample data files, they should be placed in a subdirectory named data/, and should
    be checked into git-lfs.

Files:

  • examples/observability/simple_calculator_observability/configs/config-dbnl.yml
{docs/source/**/*.md,**/README.@(md|ipynb)}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{docs/source/**/*.md,**/README.@(md|ipynb)}: Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)
Do not use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq) in documentation unless explicitly referring to deprecated names
Never use “NAT”/“nat” abbreviations in documentation
Documentation must be clear/comprehensive; avoid TODOs/FIXMEs/placeholders; avoid offensive/outdated terms; ensure spelling is correct

Files:

  • docs/source/workflows/observe/index.md
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
docs/source/**/*.md

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

docs/source/**/*.md: Documentation sources are Markdown files under docs/source
Surround code entities with backticks in docs to avoid Vale false positives
Do not use words listed in ci/vale/styles/config/vocabularies/nat/reject.txt; accepted words in accept.txt are allowed

Files:

  • docs/source/workflows/observe/index.md
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
docs/source/**/*

⚙️ CodeRabbit configuration file

This directory contains the source code for the documentation. All documentation should be written in Markdown format. Any image files should be placed in the docs/source/_static directory.

Files:

  • docs/source/workflows/observe/index.md
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.py: In code comments use the abbreviations: nat (API namespace/CLI), nvidia-nat (package), NAT (env var prefixes); never use these abbreviations in documentation
Follow PEP 20 and PEP 8 for Python style
Run yapf with column_limit=120; yapf is used for formatting (run second)
Indent with 4 spaces (no tabs) and end each file with a single trailing newline
Use ruff (ruff check --fix) as a linter (not formatter) per pyproject.toml; fix warnings unless explicitly ignored
Respect Python naming schemes: snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
When re-raising exceptions, use bare raise to preserve stack trace; log with logger.error(), not logger.exception()
When catching and logging without re-raising, use logger.exception() to capture full stack trace
Provide Google-style docstrings for every public module, class, function, and CLI command
Docstring first line must be a concise description ending with a period
Validate and sanitize all user input, especially in web or CLI interfaces
Prefer httpx with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use async/await for I/O-bound work (HTTP, DB, file I/O)
Cache expensive computations with functools.lru_cache or an external cache when appropriate
Leverage NumPy vectorized operations when beneficial and feasible

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
{src/**/*.py,packages/*/src/**/*.py}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{src/**/*.py,packages/*/src/**/*.py}: All importable Python code must live under src/ or packages//src/
All public APIs must have Python 3.11+ type hints on parameters and return values
Prefer typing/collections.abc abstractions (e.g., Sequence over list)
Use typing.Annotated for units or metadata when useful
Treat pyright warnings as errors during development

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/*/src/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

If a package contains Python code, it must have tests in a tests/ directory at the same level as pyproject.toml

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/**/*

⚙️ CodeRabbit configuration file

packages/**/*: - This directory contains optional plugin packages for the toolkit, each should contain a pyproject.toml file. - The pyproject.toml file should declare a dependency on nvidia-nat or another package with a name starting
with nvidia-nat-. This dependency should be declared using ~=<version>, and the version should be a two
digit version (ex: ~=1.0).

  • Not all packages contain Python code, if they do they should also contain their own set of tests, in a
    tests/ directory at the same level as the pyproject.toml file.

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
🧬 Code graph analysis (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (3)
tests/nat/data_models/test_common.py (1)
  • BatchConfigMixin (158-159)
src/nat/cli/type_registry.py (1)
  • register_telemetry_exporter (412-420)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.py (1)
  • OTLPSpanAdapterExporter (26-99)
🪛 markdownlint-cli2 (0.18.1)
docs/source/workflows/observe/observe-workflow-with-dbnl.md

93-93: Bare URL used

(MD034, no-bare-urls)

🪛 Ruff (0.14.1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py

207-207: Unused function argument: builder

(ARG001)


214-214: Avoid specifying long messages outside the exception class

(TRY003)


217-217: Avoid specifying long messages outside the exception class

(TRY003)


226-226: Avoid specifying long messages outside the exception class

(TRY003)

🔇 Additional comments (2)
docs/source/workflows/observe/index.md (1)

136-146: DBNL additions look correct and sorted.

Entries are alphabetized and link to the new page consistently across the list, table, and toctree. No further action needed.

Also applies to: 149-164, 201-213

examples/observability/simple_calculator_observability/configs/config-dbnl.yml (1)

17-30: LGTM: runnable minimal config.

  • Uses env-based DBNL credentials (good).
  • Updated calculator/current_datetime layout matches recent guidance.
  • Tool names reflect both tools.

No changes requested.

Also applies to: 31-38, 46-51

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1)

206-207: Add return type hint and address unused parameter.

The function is missing a return type hint, which violates the coding guideline: "All public APIs must have Python 3.11+ type hints on parameters and return values." Additionally, the builder parameter is unused, triggering Ruff ARG001.

Apply this diff to add the return type and silence ARG001:

+from collections.abc import AsyncIterator
+from typing import Any
+
 @register_telemetry_exporter(config_type=DBNLTelemetryExporter)
-async def dbnl_telemetry_exporter(config: DBNLTelemetryExporter, builder: Builder):
+async def dbnl_telemetry_exporter(
+    config: DBNLTelemetryExporter, _builder: Builder
+) -> AsyncIterator[Any]:
     """Create a DBNL telemetry exporter."""

Note: Based on learnings from the past review, this was flagged but appears not to have been fully resolved yet.

🧹 Nitpick comments (2)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (2)

198-204: Consider documenting environment variable fallbacks in field descriptions.

The field descriptions are concise but could be enhanced to inform users about the environment variable fallback mechanism. This would improve the developer experience and make zero-configuration setup more discoverable.

Apply this diff to enhance the field descriptions:

-    api_url: str | None = Field(description="The DBNL API URL.", default=None)
-    api_token: str | None = Field(description="The DBNL API token.", default=None)
-    project_id: str | None = Field(description="The DBNL project id.", default=None)
+    api_url: str | None = Field(
+        description="The DBNL API URL. Falls back to DBNL_API_URL environment variable.",
+        default=None
+    )
+    api_token: str | None = Field(
+        description="The DBNL API token. Falls back to DBNL_API_TOKEN environment variable.",
+        default=None
+    )
+    project_id: str | None = Field(
+        description="The DBNL project ID. Falls back to DBNL_PROJECT_ID environment variable.",
+        default=None
+    )

212-227: Validation logic is solid and follows established patterns.

The validation for required credentials with environment variable fallbacks is well-implemented. The error messages are clear, and the validation happens before constructing the exporter.

Optional improvement: The long error messages trigger Ruff TRY003 warnings. While they match existing patterns in this file (lines 50, 85), you could optionally define custom exception classes for more idiomatic error handling:

class DBNLConfigError(ValueError):
    """Configuration error for DBNL telemetry exporter."""
    pass

However, this is a minor stylistic choice and the current approach is acceptable given the codebase patterns.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea5730 and 2ad4e28.

📒 Files selected for processing (2)
  • docs/source/extend/telemetry-exporters.md (3 hunks)
  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/source/extend/telemetry-exporters.md
🧰 Additional context used
📓 Path-based instructions (6)
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.py: In code comments use the abbreviations: nat (API namespace/CLI), nvidia-nat (package), NAT (env var prefixes); never use these abbreviations in documentation
Follow PEP 20 and PEP 8 for Python style
Run yapf with column_limit=120; yapf is used for formatting (run second)
Indent with 4 spaces (no tabs) and end each file with a single trailing newline
Use ruff (ruff check --fix) as a linter (not formatter) per pyproject.toml; fix warnings unless explicitly ignored
Respect Python naming schemes: snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
When re-raising exceptions, use bare raise to preserve stack trace; log with logger.error(), not logger.exception()
When catching and logging without re-raising, use logger.exception() to capture full stack trace
Provide Google-style docstrings for every public module, class, function, and CLI command
Docstring first line must be a concise description ending with a period
Validate and sanitize all user input, especially in web or CLI interfaces
Prefer httpx with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use async/await for I/O-bound work (HTTP, DB, file I/O)
Cache expensive computations with functools.lru_cache or an external cache when appropriate
Leverage NumPy vectorized operations when beneficial and feasible

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
{src/**/*.py,packages/*/src/**/*.py}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{src/**/*.py,packages/*/src/**/*.py}: All importable Python code must live under src/ or packages//src/
All public APIs must have Python 3.11+ type hints on parameters and return values
Prefer typing/collections.abc abstractions (e.g., Sequence over list)
Use typing.Annotated for units or metadata when useful
Treat pyright warnings as errors during development

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/*/src/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

If a package contains Python code, it must have tests in a tests/ directory at the same level as pyproject.toml

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
**/*

⚙️ CodeRabbit configuration file

**/*: # Code Review Instructions

  • Ensure the code follows best practices and coding standards. - For Python code, follow
    PEP 20 and
    PEP 8 for style guidelines.
  • Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
    Example:
    def my_function(param1: int, param2: str) -> bool:
        pass
  • For Python exception handling, ensure proper stack trace preservation:
    • When re-raising exceptions: use bare raise statements to maintain the original stack trace,
      and use logger.error() (not logger.exception()) to avoid duplicate stack trace output.
    • When catching and logging exceptions without re-raising: always use logger.exception()
      to capture the full stack trace information.

Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any

words listed in the ci/vale/styles/config/vocabularies/nat/reject.txt file, words that might appear to be
spelling mistakes but are listed in the ci/vale/styles/config/vocabularies/nat/accept.txt file are OK.

Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,

and should contain an Apache License 2.0 header comment at the top of each file.

  • Confirm that copyright years are up-to date whenever a file is changed.

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
packages/**/*

⚙️ CodeRabbit configuration file

packages/**/*: - This directory contains optional plugin packages for the toolkit, each should contain a pyproject.toml file. - The pyproject.toml file should declare a dependency on nvidia-nat or another package with a name starting
with nvidia-nat-. This dependency should be declared using ~=<version>, and the version should be a two
digit version (ex: ~=1.0).

  • Not all packages contain Python code, if they do they should also contain their own set of tests, in a
    tests/ directory at the same level as the pyproject.toml file.

Files:

  • packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py
🧬 Code graph analysis (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (3)
tests/nat/data_models/test_common.py (1)
  • BatchConfigMixin (158-159)
src/nat/cli/type_registry.py (1)
  • register_telemetry_exporter (412-420)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/otlp_span_adapter_exporter.py (1)
  • OTLPSpanAdapterExporter (26-99)
🪛 Ruff (0.14.1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py

207-207: Unused function argument: builder

(ARG001)


214-214: Avoid specifying long messages outside the exception class

(TRY003)


217-217: Avoid specifying long messages outside the exception class

(TRY003)


226-226: Avoid specifying long messages outside the exception class

(TRY003)

🔇 Additional comments (1)
packages/nvidia_nat_opentelemetry/src/nat/plugins/opentelemetry/register.py (1)

229-237: LGTM! Exporter configuration is complete and correct.

The OTLPSpanAdapterExporter is properly configured with all required parameters (endpoint, headers) and batch configuration is correctly passed through from the config object.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Renaud Bourassa <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
docs/source/workflows/observe/observe-workflow-with-dbnl.md (1)

92-92: Format bare URL properly (MD034 violation).

The bare URL at line 92 should be wrapped in angle brackets for proper Markdown rendering. This is a duplicate of the previous feedback that was partially addressed.

Apply this diff:

-1. Navigate to your DBNL deployment (e.g. http://localhost:8080/)
+1. Navigate to your DBNL deployment (e.g. <http://localhost:8080/>)
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ad4e28 and a00c040.

📒 Files selected for processing (1)
  • docs/source/workflows/observe/observe-workflow-with-dbnl.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
{docs/source/**/*.md,**/README.@(md|ipynb)}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{docs/source/**/*.md,**/README.@(md|ipynb)}: Use the full name “NVIDIA NeMo Agent toolkit” on first use in documentation, then “NeMo Agent toolkit”; in headings use “NeMo Agent Toolkit” (capital T)
Do not use deprecated names (Agent Intelligence toolkit, aiqtoolkit, AgentIQ, AIQ/aiq) in documentation unless explicitly referring to deprecated names
Never use “NAT”/“nat” abbreviations in documentation
Documentation must be clear/comprehensive; avoid TODOs/FIXMEs/placeholders; avoid offensive/outdated terms; ensure spelling is correct

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
docs/source/**/*.md

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

docs/source/**/*.md: Documentation sources are Markdown files under docs/source
Surround code entities with backticks in docs to avoid Vale false positives
Do not use words listed in ci/vale/styles/config/vocabularies/nat/reject.txt; accepted words in accept.txt are allowed

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

{**/*.py,**/*.sh,**/*.md,**/*.toml,**/*.y?(a)ml,**/*.json,**/*.txt,**/*.ini,**/*.cfg,**/*.ipynb}: Every file must start with the standard SPDX Apache-2.0 header
Confirm copyright years are up to date when a file is changed
All source files must include the SPDX Apache-2.0 header template (copy from an existing file)

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
**/*

⚙️ CodeRabbit configuration file

**/*: # Code Review Instructions

  • Ensure the code follows best practices and coding standards. - For Python code, follow
    PEP 20 and
    PEP 8 for style guidelines.
  • Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
    Example:
    def my_function(param1: int, param2: str) -> bool:
        pass
  • For Python exception handling, ensure proper stack trace preservation:
    • When re-raising exceptions: use bare raise statements to maintain the original stack trace,
      and use logger.error() (not logger.exception()) to avoid duplicate stack trace output.
    • When catching and logging exceptions without re-raising: always use logger.exception()
      to capture the full stack trace information.

Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any

words listed in the ci/vale/styles/config/vocabularies/nat/reject.txt file, words that might appear to be
spelling mistakes but are listed in the ci/vale/styles/config/vocabularies/nat/accept.txt file are OK.

Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,

and should contain an Apache License 2.0 header comment at the top of each file.

  • Confirm that copyright years are up-to date whenever a file is changed.

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
docs/source/**/*

⚙️ CodeRabbit configuration file

This directory contains the source code for the documentation. All documentation should be written in Markdown format. Any image files should be placed in the docs/source/_static directory.

Files:

  • docs/source/workflows/observe/observe-workflow-with-dbnl.md
🪛 markdownlint-cli2 (0.18.1)
docs/source/workflows/observe/observe-workflow-with-dbnl.md

92-92: Bare URL used

(MD034, no-bare-urls)

Copy link
Member

@willkill07 willkill07 left a comment

Choose a reason for hiding this comment

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

Just a fix for the markdown -- otherwise LGTM

@willkill07
Copy link
Member

/ok to test a00c040

Signed-off-by: Renaud Bourassa <[email protected]>
@willkill07
Copy link
Member

/ok to test 61893fc

@willkill07 willkill07 self-assigned this Oct 27, 2025
@willkill07
Copy link
Member

@dbnl-renaud thank you for your contribution! I will be merging as soon as CI is green :)

@willkill07
Copy link
Member

/merge

@rapids-bot rapids-bot bot merged commit a9b81db into NVIDIA:develop Oct 27, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for exporting telemetry to DBNL

2 participants