docs(observability): document metric label-key aliases#3767
Conversation
This is the documentation half of NVIDIA#3752. Document the narrow `#[label(name = "...")]` compatibility form beside the instrumentation guide's label and reserved-field rules. It preserves a frozen Prometheus label key while generated logs keep the domain-specific Rust field name, with bare `#[label]` remaining the default. This supports NVIDIA#3732 Signed-off-by: Chet Nichols III <chetn@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughThe instrumentation documentation now explains how ChangesObservability Documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pull-request-3767.docs.buildwithfern.com/infra-controller |
|
@coderabbitai full_review, thanks! |
|
✅ Action performedFull review finished. |
The API state-change hook, managed-host republisher, and rack BMS worker
counted DSX publish outcomes separately from their matching diagnostics.
Typed sibling `Event`s now pair those signals while preserving the
frozen `{component,status}` series and each publisher's historical log
behavior. Operational detail remains log-only. The narrow `#[label(name
= "component")]` alias keeps the existing metric key without colliding
with the Event log's reserved `component` identity, and field-attribute
diagnostics reject unsupported metadata instead of silently ignoring it.
Table-driven tests cover the outcome matrix and alias guardrails.
## Related issues
- This supports #3732
- Documentation: #3767
- Part of #3169
## Type of Change
- [ ] **Add** - New feature or capability
- [ ] **Change** - Changes in existing functionality
- [ ] **Fix** - Bug fixes
- [ ] **Remove** - Removed features or deprecated functionality
- [x] **Internal** - Internal changes (refactoring, tests, docs, etc.)
## Breaking Changes
- [ ] **This PR contains breaking changes**
## Testing
- [x] Unit tests added/updated
- [x] Integration tests added/updated
- [ ] Manual testing performed
- [ ] No testing required (docs, internal refactor, etc.)
The bounded component/status mappings and publish-outcome metric/log
matrix use `value_scenarios!`; the proc-macro diagnostics use named
`check_values` rows. Stateful queue, republisher, and rack BMS behavior
remains covered by their existing focused tests.
Verified with:
- `cargo test -p carbide-instrument-macros -p carbide-instrument -p
carbide-mqtt-common`
- `cargo test -p carbide-api-core mqtt_state_change_hook --lib`
- `cargo test -p carbide-rack bms_client --lib`
- `cargo make format-nightly`
- `cargo make clippy`
- `cargo make carbide-lints`
- `cargo make check-event-names`
- `cargo xtask check-metric-docs`
- `cargo make check-workspace-deps`
- `cargo make check-licenses`
- `cargo make check-bans`
## Additional Notes
The `#[label(name = "component")]` guardrail tests and code-local
rustdoc stay with the implementation. The broader instrumentation-guide
update is split into #3767 and depends on this PR.
This PR and #3746 both extend Event field-attribute parsing. Merge
reconciliation must retain #3746's `#[context(value)]` mode and this
PR's bare-only `#[observation]` validation; metric-key aliases remain
exclusive to `#[label(name = "...")]`.
Signed-off-by: Chet Nichols III <chetn@nvidia.com>
This is the documentation half of #3752.
Document the narrow
#[label(name = "...")]compatibility form beside the instrumentation guide's label and reserved-field rules. It preserves a frozen Prometheus label key while generated logs keep the domain-specific Rust field name, with bare#[label]remaining the default.Related issues
Type of Change
Breaking Changes
Testing
Verified with:
cargo make format-nightlygit diff --checkThe parser, rustdoc, guardrail tests, and first DSX use remain with #3752.
Additional Notes
This docs PR depends on #3752 and should merge after it so
maindoes not advertise syntax before the implementation is available. The code-local rustdoc and guardrail tests stay with the implementation.