Workiva / opentelemetry-dart

Apache License 2.0
58 stars 33 forks source link

[Question] What is correct way to call Context.current.span now? #173

Closed dankhan-helmet closed 2 months ago

dankhan-helmet commented 3 months ago

Prior to 0.18.1 I had used Context.current.span to access the current span and add attributes to it in my code.

This approach has been deprecated in recent versions, but the deprecation notes don't suggest or point to what to use instead.

I'm struggling to find documentation to tell me what the recommended way to do this is now. Any pointers? 🙏🏼

dankhan-helmet commented 3 months ago

Note also this is the recommend way of calling it in the latest readme.md file, but that way is now deprecated.

"To avoid needing to pass spans around as arguments to other functions, you can get the current span with Context.current.span."