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

Missing http.target in HTTP Outgoing spans to sampling using ParentBasedSampler #2320

Closed
1 task done
habmic opened this issue Jul 4, 2021 · 0 comments · Fixed by #2349
Closed
1 task done

Missing http.target in HTTP Outgoing spans to sampling using ParentBasedSampler #2320

habmic opened this issue Jul 4, 2021 · 0 comments · Fixed by #2349

Comments

@habmic
Copy link

habmic commented Jul 4, 2021

Hi,
We are trying to have a sample rate on a specific use case in a customer app. Service is having an interval that every X seconds send an API call to another service. This means the root span is an HTTP Outgoing, we would like to apply the sampling rule on a specific http.url (/api/v1/test for example).

ParentBasedSampler is the sampler we use, and it decides to sample are not when a span is starting i.e in startSpan function. This means we must have access to http.url orhttp.target (otherwise we won't know if it should be sampled), however, those are being added to the span only once it ends even though the is purely request data and not related to the response.

[SemanticAttributes.HTTP_TARGET]: requestOptions.path || '/',
here you can see the outgoing data being set once the span closes and the data it uses is request data.

Do you know if this is the expected behavior?

  • This only affects the JavaScript OpenTelemetry library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant