Skip to content

feat(health): add structured OTLP health-report attributes - #4510

Open
nvrzeznik wants to merge 1 commit into
NVIDIA:mainfrom
nvrzeznik:pull-request/4508
Open

feat(health): add structured OTLP health-report attributes#4510
nvrzeznik wants to merge 1 commit into
NVIDIA:mainfrom
nvrzeznik:pull-request/4508

Conversation

@nvrzeznik

Copy link
Copy Markdown

Health reports reached OTLP as a prose summary body and a single event.type attribute, so consumers had to parse free text to recover the source, probe results, and alert classifications behind a report.

Emit a versioned health_report.* attribute contract alongside the unchanged summary body: scalar routing fields plus nested successes and alerts that preserve probe IDs, targets, messages, and classifications. The record now carries the report's own observation time when it has one, leaving observed_time_unix_nano as the export time.

Related issues

#4508

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.)

Additional Notes

None

@nvrzeznik
nvrzeznik requested review from a team and polarweasel as code owners August 3, 2026 22:41
@copy-pr-bot

copy-pr-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

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

coderabbitai Bot commented Aug 3, 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: 13872176-b32f-412b-8794-3bbc05404c5b

📥 Commits

Reviewing files that changed from the base of the PR and between 020d5fa and a9343ce.

📒 Files selected for processing (3)
  • crates/health/src/otlp/convert.rs
  • crates/health/src/sink/events.rs
  • docs/architecture/health_aggregation.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/architecture/health_aggregation.md
  • crates/health/src/sink/events.rs
  • crates/health/src/otlp/convert.rs

Summary by CodeRabbit

  • New Features

    • Health-report telemetry now includes structured details such as source, target, timestamps, counts, successes, alerts, messages, and classifications.
    • Health events use their observed timestamp when available, improving reporting accuracy.
    • Health-report targets now use consistent labels across machine, power-shelf, rack, and switch reports.
  • Documentation

    • Added documentation describing the structured health-report log format and versioning requirements.

Walkthrough

Health-report OTLP logs now include versioned structured attributes for report metadata, successes, alerts, counts, classifications, and timestamps. Target identifiers use stable serialized strings. Documentation defines the attribute contract.

Changes

Health report OTLP serialization

Layer / File(s) Summary
Stable health report target identifiers
crates/health/src/sink/events.rs
HealthReportTarget::as_str maps all target variants to lowercase identifiers. Scenario coverage verifies the mappings.
Structured OTLP health report conversion
crates/health/src/otlp/convert.rs
The converter emits structured scalar, array, and key-value-list attributes for health reports. It uses observed_at when present and the export timestamp otherwise. Tests validate timestamps, metadata, counts, successes, alerts, and classifications.
Documented OTLP health report contract
docs/architecture/health_aggregation.md
The documentation defines the v1 schema and structured health-report attributes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant HealthReport
  participant OtlpConverter
  participant OtlpLogRecord
  HealthReport->>OtlpConverter: provide report metadata and evidence
  OtlpConverter->>OtlpConverter: serialize structured AnyValue attributes
  OtlpConverter->>OtlpLogRecord: emit attributes and selected timestamp
Loading

Possibly related issues

Possibly related PRs

Suggested labels: rack health

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: structured OTLP health-report attributes.
Description check ✅ Passed The description directly explains the structured OTLP attributes, timestamp behavior, testing, and related implementation changes.
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/health/src/otlp/convert.rs`:
- Around line 880-965: Extend health report conversion coverage around
health_report_event_time or convert_event with table-driven cases for both a
supplied observed_at and an absent observed_at. Use a deterministic export
timestamp, assert the event timestamp uses observed_at when present and the
export time as fallback when absent, and verify observed_time_unix_nano remains
the supplied export timestamp in both cases.

In `@docs/architecture/health_aggregation.md`:
- Around line 287-295: Expand the OTLP health-report contract section to specify
requiredness, OTLP types, accepted values, and fallback behavior for every
attribute, including event.type="health_report", valid
source/target/classification values, and matching success_count/alert_count with
their nested arrays. Mark health_report.target and health_report.observed_at
optional, and document nested entry fields and schema_version="v1" gating. Add
timestamp semantics: time_unix_nano uses the valid observation time when
available, observed_time_unix_nano uses export time, and observed_at is RFC 3339
nanosecond UTC.
🪄 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: CHILL

Plan: Enterprise

Run ID: 28e2049c-c6c5-42cc-95d2-7793edce4345

📥 Commits

Reviewing files that changed from the base of the PR and between a64028c and 020d5fa.

📒 Files selected for processing (3)
  • crates/health/src/otlp/convert.rs
  • crates/health/src/sink/events.rs
  • docs/architecture/health_aggregation.md

Comment thread crates/health/src/otlp/convert.rs
Comment thread docs/architecture/health_aggregation.md Outdated
Health reports reached OTLP as a prose summary body and a single
event.type attribute, so consumers had to parse free text to recover the
source, probe results, and alert classifications behind a report.

Emit a versioned health_report.* attribute contract alongside the
unchanged summary body: scalar routing fields plus nested successes and
alerts that preserve probe IDs, targets, messages, and classifications.
The record now carries the report's own observation time when it has
one, leaving observed_time_unix_nano as the export time.
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