feat(health): add structured OTLP health-report attributes - #4510
feat(health): add structured OTLP health-report attributes#4510nvrzeznik wants to merge 1 commit into
Conversation
|
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 (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Summary by CodeRabbit
WalkthroughHealth-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. ChangesHealth report OTLP serialization
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
Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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/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
📒 Files selected for processing (3)
crates/health/src/otlp/convert.rscrates/health/src/sink/events.rsdocs/architecture/health_aggregation.md
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.
020d5fa to
a9343ce
Compare
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
Breaking Changes
Testing
Additional Notes
None