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

Add http.user_agent attribute before startSpan so it's available for sampling #26988

Closed
trask opened this issue Feb 10, 2022 · 2 comments
Closed
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. OpenTelemetry OpenTelemetry instrumentation

Comments

@trask
Copy link
Member

trask commented Feb 10, 2022

We had an Application Insights user try to configure sampling based on http.user_agent but was unsuccessful since that attribute is not added prior to starting the span (microsoft/ApplicationInsights-Java#2083 (comment))

private static void addPostSamplingAttributes(Span span, HttpRequest request,
HttpPipelineCallContext context) {
putAttributeIfNotEmptyOrNull(span, HTTP_USER_AGENT,
request.getHeaders().getValue("User-Agent"));

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 10, 2022
@trask trask changed the title Move Add http.user_agent attribute before startSpan so it's available for sampling Feb 10, 2022
@joshfree joshfree added Client This issue points to a problem in the data-plane of the library. Monitor - Exporter labels Feb 10, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 10, 2022
@srnagar srnagar added OpenTelemetry OpenTelemetry instrumentation and removed Monitor - Exporter labels Aug 24, 2023
@lmolkova lmolkova self-assigned this Oct 27, 2023
@lmolkova
Copy link
Member

@trask should we mark user-agent as sampling-relevant in the HTTP semconv?

@lmolkova
Copy link
Member

Closing this since user_agent.original became opt-in and Azure SDKs no longer report it

@github-actions github-actions bot locked and limited conversation to collaborators May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. OpenTelemetry OpenTelemetry instrumentation
Projects
None yet
Development

No branches or pull requests

4 participants