Repository navigation
RHINENG-28312: Fix ingestion span parenting and listener timing - #2374
MichaelMraka merged 3 commits into
Conversation
Keep per-host evaluation spans under the active consumer when they share a trace. This makes upload and user-evaluation work appear inside the processing span that actually contains it. For mixed-trace batches, preserve each host's original trace and link its evaluation to the active consumer. Cover both evaluation labels, mixed batches, and missing or invalid parent contexts. Assisted-by: GPT-6
Use each buffer's destination for its producer span and end the span immediately after evaluation publishing. Payload tracking must not inflate the evaluation publish duration. Record one buffer-wait span per traced host for time between listener processing and publication. Exclude processing overlap and retain zero-duration observations for synchronous flushes so span metrics count hosts without counting the same time twice. Skip empty flushes and release buffered span references after publishing. Add timing and failure regression coverage and document the metric boundaries. Assisted-by: GPT-6
Revert the listener buffer tracing section as requested, keeping the tracing fixes and regression tests in this change set. Assisted-by: GPT-6
Reviewer's GuideThis PR improves ingestion tracing by fixing evaluation-to-consumer parenting across trace scenarios, adding per-host buffer-wait spans that exclude overlapping processing, and tightening buffered producer instrumentation around destination selection, publish completion, empty flushes, and reference cleanup. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="base/telemetry/buffer.go" line_range="23" />
<code_context>
+// observation, keeping span-metric counts representative of all buffered hosts.
+func RecordBufferWait(parent trace.Span, topic string, enqueuedAt, publishAt time.Time) {
+ if !MQEnabled() {
+ return
+ }
+ processing, ok := parent.(sdktrace.ReadOnlySpan)
</code_context>
<issue_to_address>
**Sampled-out hosts lose wait observations**
When `OTEL_SAMPLING_RATE` is below 1 and the host's trace is sampled out, the non-recording SDK span does not satisfy `sdktrace.ReadOnlySpan`, so `RecordBufferWait` returns without creating an observation; when trace sampling is below 100%, span-derived buffer-wait counts omit those hosts.
Use an observation mechanism that is independent of trace sampling for host counts, or otherwise ensure buffer-wait observations survive parent-based sampling.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: base/telemetry/buffer.go:23
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2374 +/- ##
==========================================
+ Coverage 59.89% 60.13% +0.23%
==========================================
Files 157 158 +1
Lines 10119 10153 +34
==========================================
+ Hits 6061 6105 +44
+ Misses 3431 3423 -8
+ Partials 627 625 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Jira
RHINENG-28312
What
Correct evaluation span parenting and listener producer spans. Add per-host buffer-wait spans to capture delays between listener processing and evaluation publication.
Why
Evaluation spans currently appear outside their consumer span, producer spans can report the wrong destination and asynchronous buffer waits are missing from processing durations.
These changes improve trace readability and provide more accurate timing data for ingestion metrics.
How
Testing
Passed in the build container:
Summary by Sourcery
Improve ingestion tracing by correcting span relationships and capturing accurate per-host buffering delays.
New Features:
Bug Fixes:
Enhancements:
Tests: