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
- (Quite) A Few Words About Asyncyoric.github.io
- The Problem with OpenTelemetrycra.mr
- How Python Asyncio Works: Recreating it from Scratchjacobpadilla.com
- python - How does asyncio actually work? - Stack Overflowstackoverflow.com
- How to Build End-to-End LLM Observability in FastAPI with OpenTelemetryfreecodecamp.org
- Notes on structured concurrency, or: Go statement considered harmful - njs blogvorpus.org
- Tracing APIopentelemetry.io
- TypeScript Structured Concurrencythecandidstartup.org
- Astra for Coding: Why Are We Doing This Again?lucumr.pocoo.org
- [Java][Profiling] Async-profiler - manual by use cases | JVM/Java profiling and tuningkrzysztofslusarski.github.io
- OpenTelemetry: A Guide to Observability with Go | Blog | Luca Cavallinlucavall.in
- styleguide | Style guides for Google-originated open-source projectsgoogle.github.io