Skip to content

docs(instrument): explain native Event context values#3768

Open
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3731-docs
Open

docs(instrument): explain native Event context values#3768
chet wants to merge 1 commit into
NVIDIA:mainfrom
chet:gh-issue-3731-docs

Conversation

@chet

@chet chet commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This is the documentation half of #3746.

Document the narrow #[context(value)] form for Event context that must retain its structured tracing type. The guide names the supported native types, requires checked lossless conversion for other numeric widths, and keeps Display as the fallback when that guarantee is unavailable.

Related issues

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Verified with:

  • cargo make format-nightly
  • git diff --check

The native-value and parser coverage remains with #3746.

Additional Notes

This docs PR depends on #3746 and should merge after it so main does not advertise syntax before the implementation is available. The crate-level example and derive documentation remain with the code so their Rust examples are compiled against the API they describe.

This is the documentation half of NVIDIA#3746.

Document the narrow `#[context(value)]` form for Event context that must retain its structured tracing type. The guide names the supported native types, requires checked lossless conversion for other numeric widths, and keeps `Display` as the fallback when that guarantee is unavailable.

This supports NVIDIA#3731

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet
chet requested a review from polarweasel as a code owner July 21, 2026 06:05
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: baed3e1c-71c5-4f99-98d9-9b4be1ebc1e4

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad44c6 and ede0134.

📒 Files selected for processing (1)
  • docs/observability/instrumentation.md

Summary by CodeRabbit

  • Documentation
    • Clarified which field types are supported when using #[context(value)] to preserve native structured values (bool, i64, f64, or String).
    • Added guidance for safely performing checked, lossless conversions for other numeric widths, and defaulting to Display formatting for unsupported types.

Walkthrough

The instrumentation guide clarifies supported #[context(value)] types, checked lossless conversion requirements for other numeric widths, and fallback to Display formatting.

Changes

Observability documentation

Layer / File(s) Summary
Clarify context value rules
docs/observability/instrumentation.md
Documents native structured representation for bool, i64, f64, and String; checked lossless conversion for other numeric widths; and default Display formatting otherwise.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the documentation update about native Event context values.
Description check ✅ Passed The description accurately matches the doc-only change and its scoped guidance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

chet commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@chet: Initiating a full review of the PR.

🐇🔍

✅ Action performed

Full review finished.

@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant