DataDog / dd-trace-dotnet

.NET Client Library for Datadog APM
https://docs.datadoghq.com/tracing/
Apache License 2.0
450 stars 140 forks source link

[Feature Request] Automatically generated http-client service is not granular enough #5996

Open 18swenskiq opened 2 months ago

18swenskiq commented 2 months ago

Is your feature request related to a problem? Please describe. Currently, Datadog automatic insutrumentation will put any calls done by HttpClient in a separate service. This is fine, however our application calls many different things via HttpClient and this makes the single http-client service in Datadog extremely noisy.

Describe the solution you'd like We would like to be able to make the http-client service generation more granular. For example, we communicate with a specific API via HttpClient that I will call internal. So there would be some ability (in code probably?) to group together these calls and instead of putting everything under my-app-http-client, I could put some of my choosing under my-app-internal.

Describe alternatives you've considered While I think being able to define a nice common name (in code?) is good, I think there are other things that would do the same thing. A few I have considered are:

Additional context I have attempted to do this manually by adding an interceptor to the HttpClient call to manually change the service name, however it appears I'm only able to change the tracer context information of the call that called the route that then used the HttpClient, which is not what I want.

hector-escalante commented 1 month ago

For PHP Tracer there's an env var DD_TRACE_HTTP_CLIENT_SPLIT_BY_DOMAIN that separates it using resource domains, this could be enabled for dotnet core?

Ref: https://docs.datadoghq.com/tracing/trace_collection/library_config/php#traces

bouwkast commented 1 month ago

Hi @18swenskiq,

I don't think we have a way to do this automatically in the .NET Tracer at the moment.

To help expedite this feature request could you create a feature request ticket for Datadog Support? Here's a direct link for one for the .NET Tracer: https://help.datadoghq.com/hc/requests/new?tf_1260824651490=pt_product_type:apm&tf_1900004146284=pt_apm_language:.net&tf_1260825272270=pt_apm_category_feature_request

This will help us collect the necessary information and properly prioritize this.

Thanks!