end_on_exit=False seems to remove span from backend #2932
Unanswered
jgoodheart
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm attempting to implement open telemetry using opentelemetry.trace python module in a way that allows me to start a parent span, and start child spans under the same parent context across multiple applications.
I've achieved this with some success using propagators. All my child spans appear in backend nested under parent span however my parent span ends prematurely once it exits the context. This makes sense because the default behavior is to end recording on exit. I was hoping that by setting end_on_exit = False, the parent span would continue recording until manually ended.
with tracer.start_as_current_span(name="parent_span", end_on_exit=False) as parent_span
The behavior I see on the back end is that the parent span disappears completely by changing this flag. I thought maybe that was perhaps the behavior if a span is not manually ended? But thats just a theory. I'm having difficulty finding a way to get access to the original recording parent span to test manually ending it.
I have the parent context in my last process which is how I start my last child span. When I do
parent_span = trace.get_current_span(parent_context)
I get a Non Recording span returned. Can anyone advise on how to achieve the desired behavior of keeping the parent span recording, and how to obtain that recording span from the context so it can be manually ended ?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions