Span Issues when merging async genrators · open-telemetry/opentelemetry-python · Discussion #3792
I'm having an issue where I am merging async generators. Arbitrarily within the generators, more spans are being created. This can get messy and I would like to create a separate span for each gene...
I did not. Since the SO post was removed, I am going to copy it over here for easy repro My opentelemetry spans are losing their parents when I create them within an async generator that I then merge with another async generator. I believe the problem is that the span created within stream_fn is getting lost as the merged stream swaps between contexts on the event loop while awaiting. Now, I know that I could manually restore the context after awaiting in this scenario, butin my real scenario restoring the context manually at every await would be very clunky and error prone. how can I…
saved by
related reading
- The Problem with OpenTelemetrycra.mr
- (Quite) A Few Words About Asyncyoric.github.io
- How Python Asyncio Works: Recreating it from Scratchjacobpadilla.com
- OpenTelemetry is a CNCF Graduated Projectopentelemetry.io
- Tracing APIopentelemetry.io
- Overview | OpenTelemetryopentelemetry.io
- TypeScript Structured Concurrencythecandidstartup.org
- langfuse API documentationpython.reference.langfuse.com
- Langfuselangfuse.com
- How Long Contexts Faildbreunig.com
- Dynamic context discovery · Cursorcursor.com
- What Async Promised and What it Delivered — Causalitycausality.blog