open-telemetry / opentelemetry-dotnet-contrib

This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
https://opentelemetry.io
Apache License 2.0
421 stars 251 forks source link

[HttpClient] add {target} to span name #1918

Open muhaook opened 1 week ago

muhaook commented 1 week ago

Component

OpenTelemetry.Instrumentation.Http

What is the expected behavior?

OTel spec suggests to use {method} {target} as span name for http client. Currently, only {method} is used.

HTTP span names SHOULD be {method} {target} if there is a (low-cardinality) target available. If there is no (low-cardinality) {target} available, HTTP span names SHOULD be {method}.
The {target} SHOULD be one of the following:
url.template for HTTP Client spans if enabled and available

Some disussions on slack: https://cloud-native.slack.com/archives/C01N3BC2W7Q/p1718873199785299