feat(observability): correlate startup sessions across exports#437
Conversation
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
WalkthroughThe CLI emits one ChangesSession identity correlation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CodingAgent
participant Session
participant OTLP
participant OpenInference
participant ATIF
CodingAgent->>Session: agent start with session metadata
Session->>Session: emit session.start with session_instance_id
Session->>OTLP: root scopes and session mark
Session->>OpenInference: root scopes and session mark
Session->>ATIF: trajectory events and correlation metadata
OTLP-->>CodingAgent: root attributes and exporter trace IDs
OpenInference-->>CodingAgent: root attributes and exporter trace IDs
ATIF-->>CodingAgent: extra.nemo_relay and observed_events
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/ok to test 07e0b57 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@crates/cli/src/sessions/mod.rs`:
- Around line 1059-1065: Update scope_metadata to recover the read guard when
scope_stack.read() encounters a poisoned lock instead of calling expect and
panicking. Follow the existing recovery behavior used by the current-scope-stack
observability path, then continue obtaining root_uuid from the recovered guard.
In `@crates/core/tests/unit/observability/exporter_parity_tests.rs`:
- Around line 866-869: Update the parity test around the exporter attribute
assertions to create or capture a controlled session scope and retain its
root_uuid. Assert both otel_attributes["nemo_relay.session.instance_id"] and
openinference_attributes["nemo_relay.session.instance_id"] directly against that
expected root UUID, while preserving the existing exporter parity coverage.
🪄 Autofix (Beta)
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: b4933e0e-747c-48cb-a4ed-2e61b8fcc55f
📒 Files selected for processing (18)
crates/cli/src/sessions/mod.rscrates/cli/tests/coverage/shared/session_tests.rscrates/core/src/observability/mod.rscrates/core/src/observability/openinference.rscrates/core/src/observability/otel.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/tests/unit/observability/plugin_component_tests.rsdocs/about-nemo-relay/concepts/events.mdxdocs/configure-plugins/observability/about.mdxdocs/configure-plugins/observability/atif.mdxdocs/configure-plugins/observability/atof.mdxdocs/configure-plugins/observability/openinference.mdxdocs/configure-plugins/observability/opentelemetry.mdxdocs/nemo-relay-cli/basic-usage.mdxintegrations/coding-agents/README.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (25)
**/*.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)
In MDX files, top-of-file comments must use JSX comment delimiters (
{/*to open and*/}to close); do not use HTML comments for MDX SPDX headers
Files:
docs/about-nemo-relay/concepts/events.mdxdocs/configure-plugins/observability/atof.mdxdocs/configure-plugins/observability/about.mdxdocs/configure-plugins/observability/atif.mdxdocs/configure-plugins/observability/opentelemetry.mdxdocs/nemo-relay-cli/basic-usage.mdxdocs/configure-plugins/observability/openinference.mdx
**/*.{md,mdx}
📄 CodeRabbit inference engine (AGENTS.md)
Update
README.md,fern/, package READMEs, and binding-support notes when public behavior, package names, examples, or supported bindings change.
**/*.{md,mdx}: Prefer the documented public API, not internal shortcuts
Keep package names, repo references, and build commands current
Keep release-process and release-notes guidance in repo-maintainer docs such asRELEASING.md, not as user-facing docs pages orCHANGELOG.md
Keep stable user-facing wrappers atscripts/root in docs and examples; only point at namespaced helper paths when documenting internal maintenance work
When detailed dynamic plugin guides exist, keep Rust native plugin examples, Python worker plugin examples, andgrpc-v1protocol details on separate pagesIf links in documentation change, run
just docs-linkcheck.
Files:
docs/about-nemo-relay/concepts/events.mdxintegrations/coding-agents/README.mddocs/configure-plugins/observability/atof.mdxdocs/configure-plugins/observability/about.mdxdocs/configure-plugins/observability/atif.mdxdocs/configure-plugins/observability/opentelemetry.mdxdocs/nemo-relay-cli/basic-usage.mdxdocs/configure-plugins/observability/openinference.mdx
**/*.{md,markdown,mdx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all Markdown/MDX documentation files using the HTML comment block form.
Files:
docs/about-nemo-relay/concepts/events.mdxintegrations/coding-agents/README.mddocs/configure-plugins/observability/atof.mdxdocs/configure-plugins/observability/about.mdxdocs/configure-plugins/observability/atif.mdxdocs/configure-plugins/observability/opentelemetry.mdxdocs/nemo-relay-cli/basic-usage.mdxdocs/configure-plugins/observability/openinference.mdx
{docs,examples}/**/*
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update docs and examples.
Files:
docs/about-nemo-relay/concepts/events.mdxdocs/configure-plugins/observability/atof.mdxdocs/configure-plugins/observability/about.mdxdocs/configure-plugins/observability/atif.mdxdocs/configure-plugins/observability/opentelemetry.mdxdocs/nemo-relay-cli/basic-usage.mdxdocs/configure-plugins/observability/openinference.mdx
**/*
📄 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, usemaintain-dynamic-pluginsand 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, preferuv run pre-commit run --files <changed files...>.
Before review or handoff, runuv run pre-commit run --all-files.
Files:
docs/about-nemo-relay/concepts/events.mdxintegrations/coding-agents/README.mddocs/configure-plugins/observability/atof.mdxdocs/configure-plugins/observability/about.mdxdocs/configure-plugins/observability/atif.mdxcrates/core/tests/unit/observability/exporter_parity_tests.rsdocs/configure-plugins/observability/opentelemetry.mdxcrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rsdocs/nemo-relay-cli/basic-usage.mdxcrates/core/src/observability/openinference.rscrates/cli/tests/coverage/shared/session_tests.rscrates/cli/src/sessions/mod.rsdocs/configure-plugins/observability/openinference.mdxcrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
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/concepts/events.mdxdocs/configure-plugins/observability/atof.mdxdocs/configure-plugins/observability/about.mdxdocs/configure-plugins/observability/atif.mdxdocs/configure-plugins/observability/opentelemetry.mdxdocs/nemo-relay-cli/basic-usage.mdxdocs/configure-plugins/observability/openinference.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/concepts/events.mdxdocs/configure-plugins/observability/atof.mdxdocs/configure-plugins/observability/about.mdxdocs/configure-plugins/observability/atif.mdxdocs/configure-plugins/observability/opentelemetry.mdxdocs/nemo-relay-cli/basic-usage.mdxdocs/configure-plugins/observability/openinference.mdx
**/*.{md,rst,html,txt}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)
**/*.{md,rst,html,txt}: Always spellNVIDIAin all caps. Do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun because the name starts with an 'en' sound.
Do not add a registered trademark symbol afterNVIDIAwhen referring to the company.
Use trademark symbols with product names only when the document type or legal guidance requires them.
Verify official capitalization, spacing, and hyphenation for product names.
Precede NVIDIA product names withNVIDIAon first mention when it is natural and accurate.
Do not rewrite product names for grammar or title-case rules.
Preserve third-party product names according to the owner's spelling.
Include the company name and full model qualifier on first use when it helps identify the model.
Preserve the official capitalization and punctuation of model names.
Use shorter family names only after the full name is established.
Spell out a term on first use and put the acronym in parentheses unless the acronym is widely understood by the intended audience.
Use the acronym on later mentions after it has been defined.
For long documents, reintroduce the full term if readers might lose context.
Form plurals of acronyms withs, not an apostrophe, such asGPUs.
In headings, common acronyms can remain abbreviated. Spell out the term in the first or second sentence of the body.
Common terms such asCPU,GPU,PC,API, andUIusually do not need to be spelled out for developer audiences.
Files:
integrations/coding-agents/README.md
**/*.{md,rst,html}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)
Link the first mention of a product name when the destination helps the reader.
Files:
integrations/coding-agents/README.md
**/*.{md,rst,txt}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)
Spell
NVIDIAin all caps. Do not useNvidia,nvidia, orNV.
Files:
integrations/coding-agents/README.md
**/*.{md,rst}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)
**/*.{md,rst}: Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text. Avoid raw URLs and weak anchors such as "here" or "read more."
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative steps. Keep steps parallel and split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce.
Preferrefer tooverseewhen the wording points readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical docs.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values.
Use numerals for 10 or greater and include commas in thousands.
Do not add trademark symbols to learning-oriented docs unless the source, platform, or legal guidance explicitly requires them.
Files:
integrations/coding-agents/README.md
**/*.md
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-technical-docs.md)
**/*.md: Use title case consistently in technical documentation headings
Avoid quotation marks, ampersands, and exclamation marks in headings
Keep product, event, research, and whitepaper names in their official title case
Use title case for table headers
Do not force social-media sentence case into technical docs
Format code elements, commands, parameters, package names, and expressions in monospace
Format directories, file names, and paths in monospace using backticks
Use angle brackets inside monospace for variables inside paths, such as/home/<username>/.login
Format error messages and strings in quotation marks, keeping literal code strings in code formatting when clearer
Format UI buttons, menus, fields, and labels in bold
Use angle brackets between UI labels for menu paths, such as File > Save As
Use italics for new terms on first use, sparingly and only when introducing the term
Use italics for publication titles
Format keyboard shortcuts in plain text, such as Press Ctrl+Alt+Delete
Use owner/repo link text for GitHub repositories, preferring[NVIDIA/NeMo](link)over prose references like 'the GitHub repo'
Introduce every code block with a complete sentence
Do not make a code block complete the grammar of the previous sentence
Do not continue a sentence after a code block
Use syntax highlighting when the format supports it for code blocks
Avoid the word 'snippet' unless the surrounding docs already use it as a term of art
Keep inline method, function, and class references consistent with nearby docs, omitting empty parentheses for prose readability when no call is shown
Use descriptive anchor text that matches the destination title when possible for links
Avoid raw URLs in running text
Avoid generic anchor text such as 'here,' 'this page,' and 'read more'
Include acronyms in link text when a linked term includes an acronym
Do not link long sentences or multiple sentences
Avoid links that pull readers away from a procedure unless the link is a p...
Files:
integrations/coding-agents/README.md
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor all FFI work since it is Rust work
Runjust test-rustto validate FFI changes
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting on FFI workWhen Rust files changed as part of Go work, also run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allwhen Rust files are changed as part of Node work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files are changed as part of Node work
Runjust test-rustwhen Rust files are changed as part of Node workWhen changing the core Rust runtime or Rust-facing API surface, format Rust code with
cargo fmt(rustfmt defaults), keepcargo clippy -- -D warningsclean, and satisfycargo deny checkperdeny.toml.
**/*.rs: If any Rust code changed, always runjust test-rust.
If any Rust code changed, also runcargo fmt --all.
If any Rust code changed, also runcargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, runcargo fmt --allandcargo clippy --workspace --all-targets -- -D warningseven if relying on pre-commit.
Files:
crates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/cli/tests/coverage/shared/session_tests.rscrates/cli/src/sessions/mod.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
{crates/core,crates/adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changes to
crates/coreorcrates/adaptivemust run the full language matrix
Files:
crates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
crates/core/**/*.rs
📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
If the change touched
crates/coreor shared runtime semantics, also usevalidate-changefor broader validation
Files:
crates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions in Rust and Python: use
snake_case.
Files:
crates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/cli/tests/coverage/shared/session_tests.rscrates/cli/src/sessions/mod.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{rs,py,js,mjs,cjs,ts,tsx}: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
Files:
crates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/cli/tests/coverage/shared/session_tests.rscrates/cli/src/sessions/mod.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,py,go,js,ts,c,h}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use language-appropriate naming conventions: Rust
snake_case, C FFI exports prefixednemo_relay_, GoPascalCase, Node.jscamelCase, and Pythonsnake_case.
Files:
crates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/cli/tests/coverage/shared/session_tests.rscrates/cli/src/sessions/mod.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
**/*.{rs,go,js,ts}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding
//comment form.
Files:
crates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/cli/tests/coverage/shared/session_tests.rscrates/cli/src/sessions/mod.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.rs
crates/{core,adaptive}/**/*
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If
crates/coreorcrates/adaptivechanged, run the full validation matrix across Rust, Python, Go, and Node.js.
Files:
crates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.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.
Files:
crates/core/tests/unit/observability/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/cli/tests/coverage/shared/session_tests.rscrates/cli/src/sessions/mod.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.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/exporter_parity_tests.rscrates/core/src/observability/mod.rscrates/core/tests/unit/observability/otel_tests.rscrates/core/src/observability/openinference.rscrates/core/src/observability/otel.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/src/observability/plugin_component.rscrates/core/tests/unit/observability/plugin_component_tests.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/exporter_parity_tests.rscrates/core/tests/unit/observability/otel_tests.rscrates/cli/tests/coverage/shared/session_tests.rscrates/core/tests/unit/observability/openinference_tests.rscrates/core/tests/unit/observability/plugin_component_tests.rs
{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 cratetests/trees, and Python SDK tests belong underpython/tests.
Files:
crates/core/src/observability/mod.rscrates/core/src/observability/openinference.rscrates/cli/src/sessions/mod.rscrates/core/src/observability/otel.rscrates/core/src/observability/plugin_component.rs
crates/core/src/observability/{atif,otel,openinference}.rs
📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)
When changing the core event model, emitted fields, exporter behavior, subscriber config, or lifecycle, keep the ATIF, OpenTelemetry, and OpenInference implementations in sync.
Files:
crates/core/src/observability/openinference.rscrates/core/src/observability/otel.rs
🧠 Learnings (1)
📚 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/atof.mdxdocs/configure-plugins/observability/about.mdxdocs/configure-plugins/observability/atif.mdxdocs/configure-plugins/observability/opentelemetry.mdxdocs/configure-plugins/observability/openinference.mdx
🔇 Additional comments (19)
crates/cli/src/sessions/mod.rs (2)
925-942: LGTM!
1066-1083: LGTM! Placingsession_instance_idlast in the merge correctly makes it non-overridable, matching the test'suntrustedoverride check.crates/cli/tests/coverage/shared/session_tests.rs (2)
268-433: LGTM! Solid coverage of dedupe, non-overridable identity, UUIDv7 versioning, and turn-root parentage. As per path instructions, these assertions target lifecycle events, scope stacks, and cross-request isolation as expected.
2153-2153: LGTM! Matches theAtifCorrelation/persistence contract incrates/core/src/observability/plugin_component.rs.Also applies to: 2198-2209
crates/core/tests/unit/observability/otel_tests.rs (1)
332-351: LGTM! Coverage matches the documented root-only projection contract (roots getsession.id/user.id/nemo_relay.session.instance_id, children don't, non-stringuser_idis excluded, marks mirror the root).Also applies to: 449-460, 705-837
docs/configure-plugins/observability/opentelemetry.mdx (1)
97-111: LGTM! Accurately documents root-only projection, string-onlyuser.id, and mark propagation, consistent with the exporter tests and the prior learning on this doc's attribute-projection contract.Based on learnings, this stays consistent with the projected-attribute contract (scalar fields as dotted attributes, no
*_jsonlegacy references) previously established for this file.docs/nemo-relay-cli/basic-usage.mdx (2)
244-255: LGTM! Matches thestart_agent/scope_metadatabehavior incrates/cli/src/sessions/mod.rs(single mark, non-overridablesession_instance_id, string-onlyuser_idfor OTLP export).
273-275: 📐 Maintainability & Code Quality
ScopeStackHandlematches the session stack type here.> Likely an incorrect or invalid review comment.integrations/coding-agents/README.md (1)
194-196: LGTM! Consistent with the root-onlyuser.idprojection contract validated elsewhere in this PR.crates/core/src/observability/mod.rs (2)
120-148: 📐 Maintainability & Code QualityConfirm Required Core Runtime Validation
Confirm the changed core runtime passes
cargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings,just test-rust,cargo deny check, the full Rust/Python/Go/Node validation matrix, anduv run pre-commit run --all-files. As per coding guidelines, changes undercrates/corerequire the full language matrix and Rust validation commands.Source: Coding guidelines
142-146: 🗄️ Data Integrity & IntegrationKeep
nemo_relay.session.instance_idscope-derived
This field is intentionally read fromcurrent_scope_stack().root_uuid(), and the observability tests assert it matches the active scope and stays absent on child events.> Likely an incorrect or invalid review comment.docs/about-nemo-relay/concepts/events.mdx (1)
35-39: LGTM!crates/core/tests/unit/observability/openinference_tests.rs (1)
430-449: LGTM!Also applies to: 547-558, 808-937
crates/core/src/observability/plugin_component.rs (2)
1008-1008: LGTM!Also applies to: 1131-1139, 1257-1257, 1401-1401, 1425-1425, 1435-1458
1046-1064: 🩺 Stability & AvailabilityVerify dispatcher scope propagation for
session_instance_id.current_scope_stack()falls back to task-local, then thread-local storage, soAtifCorrelation::from_event()can pick up the worker’s root UUID unless the dispatcher explicitly preserves the emitting session’s scope.crates/core/tests/unit/observability/plugin_component_tests.rs (1)
1088-1136: LGTM!Also applies to: 1222-1237, 1544-1601
docs/configure-plugins/observability/atif.mdx (1)
46-56: LGTM!docs/configure-plugins/observability/atof.mdx (1)
102-107: LGTM!docs/configure-plugins/observability/openinference.mdx (1)
109-118: LGTM!Based on learnings, the general metadata-projection convention documented for opentelemetry.mdx ("emit scalar top-level
data/metadatafields as typed dotted OTLP attributes") is not violated here — this describes a distinct, explicitly-scoped canonical identity contract that the tests confirm coexists with generic metadata projection.Source: Learnings
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
crates/cli/tests/coverage/shared/session_tests.rs (1)
268-350: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd startup failure/retry coverage.
These tests cover duplicate starts and poisoned-lock recovery, but not failure during
ensure_agent_startedoremit_mark_event. Add a regression test that retriesAgentStartedafter such a failure and asserts exactly onesession.startmark with no stale lifecycle state.As per path instructions, tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
🤖 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 `@crates/cli/tests/coverage/shared/session_tests.rs` around lines 268 - 350, Add a regression test alongside session_start_mark_carries_stable_non_overridable_identity_once that injects a failure from ensure_agent_started or emit_mark_event, retries the same AgentStarted event, and verifies the retry succeeds with exactly one session.start mark and no stale lifecycle state. Exercise a fresh request or equivalent cross-request boundary where applicable, and clean up the subscriber consistently with the existing test.Source: Path instructions
crates/cli/src/sessions/mod.rs (1)
925-940: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winMake startup lifecycle state transactional and test its retry behavior.
A failed scope or mark emission currently leaves the session marked as started, so retries can permanently omit
session.start.
crates/cli/src/sessions/mod.rs#L925-L940: commitsession_startedonly after successful startup emission, or roll back the scope and metadata on failure.crates/cli/tests/coverage/shared/session_tests.rs#L268-L350: add failure/retry coverage asserting exactly one startup mark and no stale scope state.🤖 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 `@crates/cli/src/sessions/mod.rs` around lines 925 - 940, Update start_agent so startup state changes are transactional: do not commit session_started, agent scope, or session metadata until ensure_agent_started and the session.start emit_mark_event both succeed, or restore all prior state when either fails. In crates/cli/tests/coverage/shared/session_tests.rs lines 268-350, add failure-and-retry coverage verifying exactly one session.start mark is emitted and no stale scope state remains after the failed attempt.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 `@crates/cli/src/sessions/mod.rs`:
- Around line 925-940: Update start_agent so startup state changes are
transactional: do not commit session_started, agent scope, or session metadata
until ensure_agent_started and the session.start emit_mark_event both succeed,
or restore all prior state when either fails. In
crates/cli/tests/coverage/shared/session_tests.rs lines 268-350, add
failure-and-retry coverage verifying exactly one session.start mark is emitted
and no stale scope state remains after the failed attempt.
In `@crates/cli/tests/coverage/shared/session_tests.rs`:
- Around line 268-350: Add a regression test alongside
session_start_mark_carries_stable_non_overridable_identity_once that injects a
failure from ensure_agent_started or emit_mark_event, retries the same
AgentStarted event, and verifies the retry succeeds with exactly one
session.start mark and no stale lifecycle state. Exercise a fresh request or
equivalent cross-request boundary where applicable, and clean up the subscriber
consistently with the existing test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: afead5ed-75c6-4f63-9103-38eb3f7fdcf7
📒 Files selected for processing (2)
crates/cli/src/sessions/mod.rscrates/cli/tests/coverage/shared/session_tests.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (9)
**/*.rs
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
**/*.rs: Any Rust change must runjust test-rust
Any Rust change must runcargo fmt --all
Any Rust change must runcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allfor all FFI work since it is Rust work
Runjust test-rustto validate FFI changes
Runcargo clippy --workspace --all-targets -- -D warningsto enforce strict linting on FFI workWhen Rust files changed as part of Go work, also run
cargo fmt --all,just test-rust, andcargo clippy --workspace --all-targets -- -D warnings
**/*.rs: Runcargo fmt --allwhen Rust files are changed as part of Node work
Runcargo clippy --workspace --all-targets -- -D warningswhen Rust files are changed as part of Node work
Runjust test-rustwhen Rust files are changed as part of Node workWhen changing the core Rust runtime or Rust-facing API surface, format Rust code with
cargo fmt(rustfmt defaults), keepcargo clippy -- -D warningsclean, and satisfycargo deny checkperdeny.toml.
**/*.rs: If any Rust code changed, always runjust test-rust.
If any Rust code changed, also runcargo fmt --all.
If any Rust code changed, also runcargo clippy --workspace --all-targets -- -D warnings.
For Rust changes headed for review, runcargo fmt --allandcargo clippy --workspace --all-targets -- -D warningseven if relying on pre-commit.
Files:
crates/cli/src/sessions/mod.rscrates/cli/tests/coverage/shared/session_tests.rs
**/*.{rs,py}
📄 CodeRabbit inference engine (AGENTS.md)
Follow binding naming conventions in Rust and Python: use
snake_case.
Files:
crates/cli/src/sessions/mod.rscrates/cli/tests/coverage/shared/session_tests.rs
**/*.{rs,py,js,mjs,cjs,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{rs,py,js,mjs,cjs,ts,tsx}: UseJson = serde_json::Valuein Rust-facing runtime APIs where the existing code expects JSON payloads.
UseResult<T>withFlowErrorin core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
Files:
crates/cli/src/sessions/mod.rscrates/cli/tests/coverage/shared/session_tests.rs
**/*.{rs,py,go,js,ts,c,h}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use language-appropriate naming conventions: Rust
snake_case, C FFI exports prefixednemo_relay_, GoPascalCase, Node.jscamelCase, and Pythonsnake_case.
Files:
crates/cli/src/sessions/mod.rscrates/cli/tests/coverage/shared/session_tests.rs
**/*.{rs,go,js,ts}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all Rust, Go, JavaScript, and TypeScript source files using the corresponding
//comment form.
Files:
crates/cli/src/sessions/mod.rscrates/cli/tests/coverage/shared/session_tests.rs
{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 cratetests/trees, and Python SDK tests belong underpython/tests.
Files:
crates/cli/src/sessions/mod.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, usemaintain-dynamic-pluginsand 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, preferuv run pre-commit run --files <changed files...>.
Before review or handoff, runuv run pre-commit run --all-files.
Files:
crates/cli/src/sessions/mod.rscrates/cli/tests/coverage/shared/session_tests.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.
Files:
crates/cli/src/sessions/mod.rscrates/cli/tests/coverage/shared/session_tests.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/cli/tests/coverage/shared/session_tests.rs
🔇 Additional comments (3)
crates/cli/src/sessions/mod.rs (2)
925-940: 📐 Maintainability & Code QualityRun the required Rust validation before handoff.
Run
cargo fmt --all,just test-rust,cargo clippy --workspace --all-targets -- -D warnings, anduv run pre-commit run --all-files.As per coding guidelines, Rust changes require formatting, Rust tests, strict Clippy, and the final all-files pre-commit pass.
Source: Coding guidelines
1060-1076: LGTM!crates/cli/tests/coverage/shared/session_tests.rs (1)
352-415: LGTM!Also applies to: 417-432, 434-456, 2177-2177, 2222-2233
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
|
/ok to test 87ca1af |
|
/merge |
Overview
Adds a single lifecycle-level
session.startATOF Mark and stable root-only session correlation across OpenTelemetry, OpenInference, and ATIF.Today, Relay can carry logical session metadata such as
session_idanduser_id, but downstream trace tables do not have a stable Relay-owned value that correlates multiple exporter-native traces created during one CLI session lifecycle. This change reuses the existingScopeStack.root_uuidas that instance identifier instead of introducing a new session context, cache, or generated ID.The resulting identity model is:
session.id: harness-provided logical session ID.user.id: optional top-level stringuser_id.nemo_relay.session.instance_id: Relay's existing root scope UUID for one CLI session lifecycle.trace_id: exporter-native trace identity used to join child rows after locating trace roots.nemo_relay.uuid: existing Relay event/scope identity, unchanged.Contribution Confirmation
Details
CLI session lifecycle
session_instance_idwhose value is the session's existingScopeStack.root_uuid.session_idas the harness-provided logical ID and accepts optional top-level stringuser_id.session.startMark when the firstAgentStartedbegins a lifecycle.OpenTelemetry and OpenInference
session.id,user.id, andnemo_relay.session.instance_id.session.startcorrelated whether it is exported as an active-parent span event or a standalone Mark span.attribute_mappings; custom mappings cannot replace canonical projected fields.session_idanduser_idfor canonical aliases while retaining the raw metadata.ATIF compatibility
AtifTrajectory.session_id,trajectory_id,{session_id}filename expansion, and the remote session header unchanged.extrainstead of overwriting it.extra.nemo_relay.session_id,extra.nemo_relay.session_instance_id, and optionalextra.nemo_relay.user_id.extra.observed_eventswithout creating an ATIF step or duplicating the complete metadata object.Documentation
--session-metadata '{"user_id":"alice"}'.trace_id.extra.nemo_relay.Validation
Focused lifecycle and exporter tests cover duplicate starts, Agent-backed and turn-root-only parentage, UUIDv7 instance IDs, recreated and concurrent sessions, multiple trace roots, root-only canonical projection, orphan and active-parent Marks, custom mapping precedence, ATIF compatibility, and cross-exporter identity parity.
Post-rebase validation:
just test-rustjust test-python— 528 passedjust test-node— 264 passedjust test-gocargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningsjust docs— passed with the expected unauthenticated Fern redirect warninguv run pre-commit run --all-files— every hook passed exceptattributions-rust, which rewrites the unchangedmd-5 0.10.6entry from dual MIT/Apache licensing to Apache-only under localcargo-about 0.9.0; that unrelated generated diff was revertedNo public binding API or configuration type changes are introduced. No breaking changes are expected.
Coordination note: open PR #403 also modifies OpenInference Mark projection and some adjacent tests, but it addresses projected Mark payload aliases rather than session lifecycle correlation. This PR keeps the shared exporter changes narrowly scoped to canonical session identity.
Where should the reviewer start?
crates/cli/src/sessions/mod.rsfor session metadata enrichment and one-shotsession.startemission.crates/core/src/observability/mod.rsfor the shared canonical identity projection.crates/core/src/observability/otel.rsandopeninference.rsfor trace-root and Mark handling.crates/core/src/observability/plugin_component.rsfor compatibility-preserving ATIFextra.nemo_relayenrichment.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
session.startevent for each session, with stable correlation metadata.Summary by CodeRabbit
session.startevent for each session, with stable session-instance correlation data.Summary by CodeRabbit
session.startevent for each session, with stable session-instance correlation metadata.