-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding request-based tags to url session spans #1649
Comments
Indeed iOS SDK doesn't have similar feature to intercept the span created by the instrumentation. We can provide something similar here in the form of either delegate or a closure. You can pass this as part of |
@ganeshnj that sounds perfect. Thank you for such swift response! |
I have the same needs as the current issue
@ganeshnj Can you provide sample code for the method you suggested in your answer? |
Like I said, we don't have such capability as of now in the iOS SDK but something we can provide in future. Thanks for upvoting, it helps us prioritize the issues. |
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 configuringtags
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 solutionDescribe alternatives you've considered
I thought I could achieve it by accessing
Tracer.shared().activeSpan
in my implementation ofDatadogURLSessionHandler
but it is not populated. I also tried to somehow create a span with trace id and span id fromURLSessionTaskInterception
received in my implementation ofDatadogURLSessionHandler
but I don't see a way of doing that.Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: