Skip to content
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

High HTTP span name cardinality with opentelemetry extension #16952

Closed
hacst opened this issue May 3, 2021 · 3 comments · Fixed by #17676
Closed

High HTTP span name cardinality with opentelemetry extension #16952

hacst opened this issue May 3, 2021 · 3 comments · Fixed by #17676
Labels
area/tracing kind/bug Something isn't working
Milestone

Comments

@hacst
Copy link
Contributor

hacst commented May 3, 2021

Describe the bug

When using the new opentelemetry extension and observing HTTP client and server spans their names contain the full path of the URI. This means if for example an ID is part of a URI it ends up being part of the name of the span. The OTEL specification states that such high cardinality names are unsuitable for spans: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#name HTTP. More specifically for it states "Instrumentation MUST NOT default to using URI path as span name".

Unfortunately the current implementation does not comply with that:

SpanBuilder builder = tracer.spanBuilder(requestContext.getUri().getPath().substring(1))

SpanBuilder builder = tracer.spanBuilder(routingContext.request().uri().substring(1))

The effect of the current implementation in backends like jaeger is that the spans cannot be grouped and the ability to view spans for a operation becomes unusable.

Fixing this for the server is probably similar to the solution for #15044 so maybe the work done based on that can be re-used.

Expected behavior

Span names matching the HTTP conventions described in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#name .

Actual behavior

The full path becomes part of the name producing high cardinality span names.

To Reproduce

Add the extension to any project creating or receiving requests with a variable parameter in the URL and observe the names of HTTP spans created.

Quarkus version or git rev

1.13.3.Final

@hacst hacst added the kind/bug Something isn't working label May 3, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented May 3, 2021

/cc @kenfinnigan

@kenfinnigan
Copy link
Member

We aware of the problem, and we're in the process of determining the appropriate path handling for metrics and traces that can utilize the same name

@hacst
Copy link
Contributor Author

hacst commented May 3, 2021

Great. Thanks a lot for your work on this extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tracing kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants