opentelemetry-python-contrib icon indicating copy to clipboard operation
opentelemetry-python-contrib copied to clipboard

fix(instrumentation-asgi): remove high cardinal path from span name

Open srikanthccv opened this issue 1 year ago • 0 comments
trafficstars

Description

The path value of the ASGI scope is a non-generalized path. This is not an issue in other frameworks such as fastapi or falsk where the templatized path is accessible. This PR updates the span name to not contain the high cardinal value for ASGI instrumentation span names. The highly cardinal span names will become a problem when used with the span metrics connection from the collector.

The spec guidelines say https://opentelemetry.io/docs/specs/otel/trace/api/#span

The span name concisely identifies the work represented by the Span, for example, an RPC method name, a function name, or the name of a subtask or stage within a larger computation. The span name SHOULD be the most general string that identifies a (statistically) interesting class of Spans, rather than individual Span instances while still being human-readable. That is, “get_user” is a reasonable name, while “get_user/314159”, where “314159” is a user ID, is not a good name due to its high cardinality. Generality SHOULD be prioritized over human-readability.

srikanthccv avatar Jul 02 '24 08:07 srikanthccv