-
Notifications
You must be signed in to change notification settings - Fork 155
Description
Is your feature request related to a problem? Please describe.
Use case: I would like the span to include additional tag with GraphQL operation name in it.
Right now, when using built-in URLSessionInstrumentation
, it is only possible to add static tags to all requests by configuring tags
property when enabling tracing. I would like to add tags with dynamic values, depending on what request is being made.
Currently there is no way to access the span created by TracingURLSessionHandler
On Android it is possible to do this by using TracedRequestListener

Describe the solution you'd like
A possibility to define listeners/callbacks for URLSessionInstrumentation
which would allow editing the span based on the request. Similar to the Android solution
Describe alternatives you've considered
I thought I could achieve it by accessing Tracer.shared().activeSpan
in my implementation of DatadogURLSessionHandler
but it is not populated. I also tried to somehow create a span with trace id and span id from URLSessionTaskInterception
received in my implementation of DatadogURLSessionHandler
but I don't see a way of doing that.
Additional context
Add any other context or screenshots about the feature request here.