OTEL improvements - #146
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
maximusunc
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OTEL improvements: trace noise reduction and richer callback attributes
Summary
Four related changes to the OpenTelemetry instrumentation: drop noisy low-value ASGI spans, add payload/result-size attributes to ARA callbacks, standardize every custom attribute onto dotted namespaces, and split callback delivery timing into HTTP time vs. retry backoff.
Changes
1. Drop ASGI send/receive spans (
shepherd_server/server.py)FastAPIInstrumentor.instrument_appnow passesexclude_spans=["receive", "send"]. These per-ASGI-message spans represent individual events within a larger message and flood the backend with traces that carry no useful signal.2. Add attributes to the ARA callback span (
shepherd_server/base_routes.py)The
callbackspan now records the shape of what arrived, not just its ID:callback.results,callback.kg_nodes,callback.kg_edges, andcallback.payload_bytes. This makes it possible to see how much each ARA actually returned.3. Standardize attribute names onto namespaces (all workers + server)
Flat keys became dotted, so attributes group consistently in the backend:
callback_idcallback.idquery_idquery.idresponse_idresponse.iddrained_callbacksmerge.drained_callbackscallback_attempt_failed(event)callback.attempt_failedattempt,duration_ms(event attrs)callback.attempt,callback.attempt_duration_msTouches
aragorn_lookup,aragorn_pathfinder,bte_lookup,merge_message,finish_query, andbase_routes.4. Separate wait time from backoff time (
workers/finish_query/worker.py)callback.duration_msconflated time spent in HTTP requests with time spent sleeping between retries. Two new attributes split them:callback.wait_ms(summed elapsed across all attempts, successful and failed) andcallback.backoff_ms. A slow callback receiver and a flaky one now look different in the trace.