-
Notifications
You must be signed in to change notification settings - Fork 508
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
feat: Add Suppression flag to context #2821
feat: Add Suppression flag to context #2821
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2821 +/- ##
=======================================
+ Coverage 80.7% 80.9% +0.1%
=======================================
Files 124 124
Lines 23703 23833 +130
=======================================
+ Hits 19150 19281 +131
+ Misses 4553 4552 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 think that the addition is good, but you should run the benchmarks on this change. Locally for me this gives between 63% and 173% slower execution of the context_attach
benchmarks.
I have some ideas of how to remedy this.
Thanks! Yes it is somewhat surprising to me too that the attach benches regress (I do see 50-80% slow). Additionally, sharing what I believe must be the highest perf path:
Enter suppression_context - is done by background thread/exporters only and is less important to be as performant as others. |
@utpilla and I discussed another thought: When one is entering suppression mode - is there a value in keeping/cloning existing context? What good is baggage or active span, if we are in suppressed mode anyway? |
Just an alternative idea specifically for suppression logic in the synchronous case: log/span -> concurrent_processor -> exporter Can we rely on a thread-local suppression flag to handle the logic, avoiding the need for context cloning? |
As mentioned in #2821 (comment) , I don't think entering_suppression is a hot path operation to heavily perf optimize. |
Got it. For, Would it still be outside hot-path? Not a blocker, just curious how will it work. Also, once suppression is enabled, would there be situation where we need to switch it off? |
@@ -2,6 +2,26 @@ | |||
|
|||
## vNext | |||
|
|||
Added the ability to prevent recursive telemetry generation through new |
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.
Add PR link as well.
Yes you are totally right! For ConcurrentProcessor, it'll be in hot-path but I don't plan to use it for them at all. (You may have seen many PRs from me in the contrib repo, where I try to make the exporters used with ConcurrentProcessor safe from re-entrancy, so we don't have to pay the cost!) The benchmarks in this PR shows there is a 10ns cost to just attach a context, whether or not it has suppression flag in it. That cost is not something we should be paying for the re-entrant ones. That limits observability, but there are alternate ideas to address them. I hope to uncover all these in the follow up PRs, where we put the suppression flag into actual use! |
I don't see the need myself for the purposes inside this repo. But if a component author wants to, they can turn it off. There is a test that shows this too. |
This establishes the basic building block required to suppress telemetry using Context. This is a pre-requisite for solving issues like #1171 or #761
This is not yet applied anywhere, that can be in follow ups.
(I did try in Logs Sdk, and there is a 1-2 ns additional overhead to check this. It may not look much, but given Logs SDK can check IsEnabled() currently under 2 ns, this is a measurable increase in terms of percentage!. But this should not be a major concern.)
Previous attempts: #1330