Spans for long running tasks - can we send span events out as they happen? #3732
Replies: 1 comment 3 replies
-
We currently have an experimental event API which sends events as log records. There are several open questions related to the event API, but one of them is how they interact with span events? My opinion is that after we work out some of the other issues with the event API and get it stable, that we should deprecate the span event API and encourage folks to directly use the event API. Users would then be able to configure the SDK on whether events recorded in the context of a span are attached to the span as span events when exported, or exported independently as log events, with trace context fields tying back to the related span. We're working on spinning up an event working group to discuss these questions and more. |
Beta Was this translation helpful? Give feedback.
-
Spans fall short when modeling long-running events because they can't be sent until the event finishes. Child spans do get sent, but they lack any information (attributes, start time, etc.) from their parent. Nonetheless, this is still useful because at least you get some information. Unfortunately, this is not true for span events: if you add an event to a span it won't get sent until the span completes. This means that span events are in some ways inferior to child spans or just emitting an out-of-band log with correlation.
It would be really interesting if we could greedily send out span events as they occur. Further, if we could have some sort of semantic convention around an event for "a span was started but is still ongoing" then we could also improve the situation where you can get no information on a long-running span until it completes.
Beta Was this translation helpful? Give feedback.
All reactions