-
- Notifications
You must be signed in to change notification settings - Fork 153
changes to otel data #1446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes to otel data #1446
Conversation
1. prefix `SEVERITY_TEXT_` removed from severity_text in logs 2. prefix `AGGREGATION_TEMPORALITY_` removed from aggregation_temporality_description in metrics 3. field `event_duration_ms` and `span_duration_ms` added in traces 4. prefix `STATUS_CODE_` removed from span_status_description in traces 5. prefix `SPAN_FLAGS_` removed from span_flags_description in traces 6. prefix `SPAN_KIND_` removed from span_kind_description in traces
WalkthroughAdds duration fields to spans and events, expands known trace fields, changes several OTEL description strings, and strips a Changes
Sequence Diagram(s)sequenceDiagram participant Flat as flatten_span_record participant Span as Span participant Events as flatten_events participant Out as JSON output Note over Flat,Span: New/changed flow: compute span duration, pass span start to events Span->>Flat: span (start_time_unix_nano, end_time_unix_nano, events) Flat->>Flat: compute span_duration_ms = (end-start)/1_000_000 Flat->>Events: flatten_events(events, span_start_time_unix_nano) Events->>Events: for each event compute event_duration_ms = (event.time - span_start)/1_000_000 Events->>Flat: flattened events (with event_duration_ms) Flat->>Out: emit spanRecord (includes span_duration_ms and event list) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/otel/traces.rs (2)
939-942
: Critical: Status description assertion needs updating.This assertion expects the old format with the
STATUS_CODE_
prefix, which will cause the test to fail.Apply this fix:
assert_eq!( record.get("span_status_description").unwrap(), - &Value::String("STATUS_CODE_OK".to_string()), + &Value::String("OK".to_string()), "Should contain status description" );
946-979
: Critical: Test missing new duration fields.The
expected_fields
array does not include the newly addedspan_duration_ms
andevent_duration_ms
fields, which will cause this test to fail.Add the missing fields to the expected array:
let expected_fields = [ "scope_name", "scope_version", "scope_schema_url", "scope_dropped_attributes_count", "resource_schema_url", "resource_dropped_attributes_count", "span_trace_id", "span_span_id", "span_name", "span_parent_span_id", "name", "span_kind", "span_kind_description", "span_start_time_unix_nano", "span_end_time_unix_nano", + "span_duration_ms", "event_name", "event_time_unix_nano", + "event_duration_ms", "event_dropped_attributes_count", "link_span_id", "link_trace_id", "link_dropped_attributes_count", "span_dropped_events_count", "span_dropped_links_count", "span_dropped_attributes_count", "span_trace_state", "span_flags", "span_flags_description", "span_status_code", "span_status_description", "span_status_message", ];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/otel/traces.rs
(9 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/otel/traces.rs (1)
src/otel/otel_utils.rs (1)
insert_attributes
(185-190)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Quest Smoke and Load Tests for Distributed deployments
- GitHub Check: Quest Smoke and Load Tests for Standalone deployments
- GitHub Check: Build Default x86_64-pc-windows-msvc
- GitHub Check: Build Default x86_64-apple-darwin
- GitHub Check: Build Default x86_64-unknown-linux-gnu
- GitHub Check: coverage
- GitHub Check: Build Default aarch64-unknown-linux-gnu
- GitHub Check: Build Kafka aarch64-apple-darwin
- GitHub Check: Build Kafka x86_64-unknown-linux-gnu
🔇 Additional comments (5)
src/otel/traces.rs (5)
30-63
: LGTM: Field list correctly updated.The additions of
span_duration_ms
andevent_duration_ms
to the known field list are consistent with the new duration calculations added in the flattening logic.
174-208
: LGTM: Event duration calculation correctly implemented.The addition of
event_duration_ms
with proper overflow protection (saturating_sub
) and graceful fallback for invalid f64 conversions is well-implemented. The signature change to acceptspan_start_time_unix_nano
correctly enables computing event duration relative to span start.
351-363
: LGTM: Span duration calculation correctly implemented.The span duration calculation follows the same robust pattern as the event duration, with proper overflow protection and graceful error handling. The implementation correctly converts nanoseconds to milliseconds.
370-370
: LGTM: Function call correctly updated.The call to
flatten_events
properly passes thespan_start_time_unix_nano
parameter required by the updated signature.
556-556
: LGTM: Test call correctly updated.The test call to
flatten_events
properly includes the requiredspan_start_time_unix_nano
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/otel/traces.rs (2)
556-593
: Add assertions forevent_duration_ms
.We now emit
event_duration_ms
, but this test never validates the numbers. Please assert the expected durations (0.0 ms for the first event, 1000.0 ms for the second) so regressions in the new field are caught.let first_event = &result[0]; @@ assert!( first_event.contains_key("service.name"), "Should contain flattened attributes" ); + assert_eq!( + first_event + .get("event_duration_ms") + .and_then(|v| v.as_f64()) + .unwrap(), + 0.0, + "First event should start at the span start time" + ); @@ let second_event = &result[1]; @@ assert_eq!( second_event.get("event_dropped_attributes_count").unwrap(), &Value::Number(0.into()), "Second event dropped count should be zero" ); + assert_eq!( + second_event + .get("event_duration_ms") + .and_then(|v| v.as_f64()) + .unwrap(), + 1000.0, + "Second event should be 1s after span start" + );
676-716
: Assertspan_duration_ms
in the span+event+link test.
span_duration_ms
is now part of every flattened record, but this test doesn't verify it. Please assert the propagated duration (1000.0 ms here) so future changes can't break the new field silently.assert_eq!( record.get("span_kind_description").unwrap(), &Value::String("SERVER".to_string()), "All records should contain span kind description" ); + assert_eq!( + record + .get("span_duration_ms") + .and_then(|v| v.as_f64()) + .unwrap(), + 1000.0, + "Span duration should be propagated to every record" + );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/otel/traces.rs
(16 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/otel/traces.rs (1)
src/otel/otel_utils.rs (1)
insert_attributes
(185-190)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Build Default aarch64-apple-darwin
- GitHub Check: Build Default aarch64-unknown-linux-gnu
- GitHub Check: Build Default x86_64-pc-windows-msvc
- GitHub Check: Build Kafka x86_64-unknown-linux-gnu
- GitHub Check: Build Default x86_64-apple-darwin
- GitHub Check: Build Default x86_64-unknown-linux-gnu
- GitHub Check: Quest Smoke and Load Tests for Distributed deployments
- GitHub Check: Build Kafka aarch64-apple-darwin
- GitHub Check: coverage
- GitHub Check: Quest Smoke and Load Tests for Standalone deployments
SEVERITY_TEXT_
removed from severity_text in logsAGGREGATION_TEMPORALITY_
removed from aggregation_temporality_description in metricsevent_duration_ms
andspan_duration_ms
added in tracesSTATUS_CODE_
removed from span_status_description in tracesSPAN_FLAGS_
removed from span_flags_description in tracesSPAN_KIND_
removed from span_kind_description in tracesSummary by CodeRabbit
New Features
Improvements