Skip to content

Observability user experiences fixes#1760

Merged
rapids-bot[bot] merged 12 commits intoNVIDIA:release/1.5from
dnandakumar-nv:latency-example-fix
Mar 10, 2026
Merged

Observability user experiences fixes#1760
rapids-bot[bot] merged 12 commits intoNVIDIA:release/1.5from
dnandakumar-nv:latency-example-fix

Conversation

@dnandakumar-nv
Copy link
Contributor

@dnandakumar-nv dnandakumar-nv commented Mar 6, 2026

Description

Improve export task handling and update LangSmith docs

Handle race conditions during export task creation, closing coroutines and logging warnings instead of propagating RuntimeErrors. Enhance test coverage for handling shutdown scenarios.

Additionally, update documentation to clarify LangChain dependencies, provide usage of --override flag for configuration, and correct environment variable naming for LangFuse.

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

  • Documentation

    • Renamed step reference to LangChain and updated install instructions; corrected Langfuse env var name.
    • Added command-line override examples and a note describing the override flag behavior.
    • Expanded structured evaluation experiments with prerequisites and guidance.
  • Bug Fixes

    • Improved observability export task shutdown/error handling to suppress coroutine warnings and log non-fatal issues.
  • Tests

    • Added/updated tests to verify error handling, warning logs, and coroutine/resource cleanup.

dnandakumar-nv and others added 7 commits February 25, 2026 10:50
Introduced the `validation_alias` using `AliasChoices` to support alternative field names for `nvext_max_sensitivity`. This enhances flexibility in handling input data, allowing the use of both "nvext_max_sensitivity" and "max_sensitivity" as valid keys.

Signed-off-by: dnandakumar-nv <dnandakumar@nvidia.com>
This update introduces `AliasChoices` to support multiple aliases for the `nvext_prediction_trie_path` field. It improves flexibility by allowing alternative names like `prediction_trie_path` for easier configuration.

Signed-off-by: dnandakumar-nv <dnandakumar@nvidia.com>
The configuration now activates nvext hints by setting `enable_nvext_hints` to true, improving integration with Dynamo nvext features. Additionally, the prediction trie path key was updated to `nvext_prediction_trie_path` for improved clarity and consistency.

Signed-off-by: dnandakumar-nv <dnandakumar@nvidia.com>
Handle race conditions during export task creation, closing coroutines and logging warnings instead of propagating RuntimeErrors. Enhance test coverage for handling shutdown scenarios.

Additionally, update documentation to clarify LangChain dependencies, provide usage of `--override` flag for configuration, and correct environment variable naming for LangFuse.

Signed-off-by: dnandakumar-nv <dnandakumar@nvidia.com>
@dnandakumar-nv dnandakumar-nv requested a review from a team as a code owner March 6, 2026 17:23
@dnandakumar-nv dnandakumar-nv added improvement Improvement to existing functionality non-breaking Non-breaking change labels Mar 6, 2026
@copy-pr-bot
Copy link

copy-pr-bot bot commented Mar 6, 2026

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 Mar 6, 2026

Walkthrough

Renames LangSmith references to LangChain in docs, adds CLI --override examples and evaluation prerequisites, corrects a Langfuse env var in an example README, and updates ProcessingExporter to close coroutines when not running and log (not raise) on RuntimeError from task creation; tests updated accordingly.

Changes

Cohort / File(s) Summary
Documentation
docs/source/run-workflows/observe/observe-workflow-with-langsmith.md, examples/observability/simple_calculator_observability/README.md
Renamed Step 1 to reference the LangChain subpackage and updated installation command; added CLI --override dot-notation usage and note; added Structured Evaluation Experiments prerequisites/notes; corrected Langfuse env var from LANGFUSE_HOST to LANGFUSE_BASE_URL.
Observability Exporter Implementation
packages/nvidia_nat_core/src/nat/observability/exporter/processing_exporter.py
In _create_export_task, explicitly close the coroutine when exporter is not running; catch RuntimeError from asyncio.create_task (e.g., loop shutdown), close coroutine, and log a warning instead of raising.
Observability Exporter Tests
packages/nvidia_nat_core/tests/nat/observability/exporter/test_processing_exporter.py
Updated tests to assert coroutine closure when exporter not running and to expect a warning (not an exception) when asyncio.create_task fails due to loop shutdown; adjusted log/message expectations and resource-cleanup assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Observability user experiences fixes' is vague and generic, using non-descriptive terms that don't convey specific information about the changes. Make the title more specific by describing the main change, such as 'Fix observability export task handling and race conditions' or 'Handle coroutine cleanup and loop shutdown in observability exporter'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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

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

@dnandakumar-nv
Copy link
Contributor Author

/ok to test 5464fdd

Copy link
Contributor

@mnajafian-nv mnajafian-nv left a comment

Choose a reason for hiding this comment

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

LGTM! Conditional approval upon addressing the inline NITs

willkill07 and others added 3 commits March 10, 2026 10:38
…_processing_exporter.py

Co-authored-by: mnajafian-nv <mnajafian@nvidia.com>
Signed-off-by: Dhruv Nandakumar <168006707+dnandakumar-nv@users.noreply.github.com>
Co-authored-by: mnajafian-nv <mnajafian@nvidia.com>
Signed-off-by: Dhruv Nandakumar <168006707+dnandakumar-nv@users.noreply.github.com>
@dnandakumar-nv
Copy link
Contributor Author

/ok to test 29196a3

    Cleaned up extraneous blank lines to improve code readability and maintain consistency. This change does not affect functionality or behavior but enhances clarity in the test file.

Signed-off-by: dnandakumar-nv <dnandakumar@nvidia.com>
@dnandakumar-nv
Copy link
Contributor Author

/ok to test a40a28e

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@packages/nvidia_nat_core/tests/nat/observability/exporter/test_processing_exporter.py`:
- Around line 1113-1123: Replace the Mock() coroutine placeholders in the
failing tests with a real coroutine object (e.g. create a simple async def
_dummy(): await asyncio.sleep(0) and instantiate it with _dummy()) before
passing it to processing_exporter._create_export_task; keep the
asyncio.create_task patch that raises RuntimeError so the internal exception
path is exercised, then assert the coroutine was properly closed by checking
cr.cr_frame is None (instead of only verifying .close() was called). Apply this
change to both test cases that call _create_export_task (the shutdown case and
the "not running" case) so the test verifies actual coroutine cleanup rather
than just a Mock.close call.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 11bb6114-d879-43aa-b832-d55c774f4a50

📥 Commits

Reviewing files that changed from the base of the PR and between 29196a3 and a40a28e.

📒 Files selected for processing (1)
  • packages/nvidia_nat_core/tests/nat/observability/exporter/test_processing_exporter.py

@dnandakumar-nv
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 23d7c6e into NVIDIA:release/1.5 Mar 10, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement to existing functionality non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants