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

Extracting span attributes before span creation and passing them to start_span/start_as_current_span #430

Open
srikanthccv opened this issue Apr 12, 2021 · 8 comments

Comments

@srikanthccv
Copy link
Member

Need for this: The ability to make sampling decision based on the attributes following semantic conventions.

I would like to customise the sampler and make my sampling decision based on incoming request metadata for web api. The instrumentations now create span with it's name and kind then conditionally populate tags if span is being recorded. If a sampler doesn't receive any metadata about the incoming request/DB call/other then I am being limited to make my decision based on tiny information available which isn't really helpful.

@lzchen
Copy link
Contributor

lzchen commented Apr 12, 2021

@lonewolf3739
You are referring to the scenario that the incoming request is from some other out-of-process thing right? So the incoming span could be non-recording (not sampled), but you may want to sample?

@srikanthccv
Copy link
Member Author

Yes, my use-case is out-of-process.

@lzchen
Copy link
Contributor

lzchen commented Apr 13, 2021

@lonewolf3739
Perhaps the TraceState field can be used for that purpose?

@srikanthccv
Copy link
Member Author

I don't find tracestate to be useful here because It is mainly used/targeted for vendor specific trace information. My simple use-case is (Collect 100% traces for sensitive endpoints based on http metadata + Probabilistic sampling for everything else).

@lzchen
Copy link
Contributor

lzchen commented Apr 14, 2021

@lonewolf3739
Right. I think differing sampling decisions across different processes have been a topic of discussion and problem that we have not been able to solve yet. The is_recording optimizing of not add any span attributes when the span is not sampled only makes sense within the confines of the current process. I would bring this up in the SIG meeting.

@github-actions
Copy link

This issue was marked stale due to lack of activity. It will be closed in 30 days.

@srikanthccv
Copy link
Member Author

Closing in favour of #936

@lzchen lzchen reopened this May 19, 2022
@lzchen
Copy link
Contributor

lzchen commented May 19, 2022

Re-opening as #936 only covers http instrumentations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants