-
Notifications
You must be signed in to change notification settings - Fork 554
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
Setup PublicEndpointFn option #2342
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2342 +/- ##
=======================================
- Coverage 74.3% 74.2% -0.1%
=======================================
Files 144 144
Lines 6563 6569 +6
=======================================
+ Hits 4877 4880 +3
- Misses 1543 1546 +3
Partials 143 143
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see this being useful for kubernetes/kubernetes#103186 :).
There was a blurp in one of the rebases, which made the test code non-parseable. I've rebased from my initial commit (dropping the merge commits). |
Marking all endpoints as public is a pretty good way to avoid orphan spans.
However, this is an all-or-nothing situation, which is rarely accurate. For example, a public API could have both external and internal customers.
External customers' requests need to be considered as public, while internal ones need not to.
This introduces a
WithPublicEndpointFn
option, which allows setting a specific request as public or not based on the return value of a function.A specific TraceContext baggage could then be set on all internal requests, to keep the context while discarding it for any request which doesn't have it.