opentelemetry-python
opentelemetry-python copied to clipboard
export unclosed span
We are using BatchSpanProcessor to batch spans and pushes them to jaeger exporter. We noticed a span is exported only when it ends.
However, our system have root span which runs across different microservice, and we hope to query span attributes from db before the span finishes.
Is there a way for us to export span once it starts, and update the span on any change in attributes or span status?
That's not possible
Well, is it possible to attach extra attributes after a span ends?
is it possible to attach extra attributes after a span ends
No, they are discarded after it ends.
Is there a way for us to export span once it starts, and update the span on any change in attributes or span status?
I'm curious if Jaeger even supports this
However, our system have root span which runs across different microservice, and we hope to query span attributes from db before the span finishes.
If you don't mind expanding a bit, what does the downstream service do with those attributes? I wouldn't count on the root span being queryable from Jaeger before the second downstream microservice queries it.
Have you looked into Baggage? This is good way to propagate some attributes downstream.
@aabmass @srikanthccv I have the same question. What's the recommended way to keep track of the on-going spans if a span is going to take long time to end?
@bigqi0812 What's your use case? How long does it take to complete?
The best option I can think of is zpages but we don't have that as of today https://github.com/open-telemetry/opentelemetry-specification/blob/main/experimental/trace/zpages.md#overview
What Lily is asking is similar to https://github.com/open-telemetry/opentelemetry-specification/issues/373
without that - we is there a way for us to view "current/inflight/inprogress" spans? @srikanthccv
No, currently there is no way to do that other than what I previously mentioned.
One can probably build a custom span processor + exporter combination to achieve but not something supported. Please raise a feature request in https://github.com/open-telemetry/opentelemetry-specification.