OXY-1514: only track sampled spans and through a setting track all spans. #107
+179
−32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're seeing high lock contention when removing spans from the
LiveReferenceSet
. Currently,we sample all spans that are created, even if those spans are unsampled. The purpose of this
is to capture graceful restart timeout issues which sometimes occur in our services. By fetching
the list of all spans in memory when a graceful restart hangs, we can figure out what is preventing
the restart from occuring within its timeout.
In this commit we only track sampled spans. Most services which use foundations sample at a 1% rate,
meaning we effectively remove 99% of locks. This allows light debugability in all running services, at
any time you can get a list of traced spans. Although those spans should end up in jaeger/oltp at some
point1. To make sure we can still determine the root cause of graceful restart issues, we add a setting
which forces all spans to be sampled (what happened previously).
Footnotes
to be fair, sometimes some traces will remain in memory forever and never be dropped, so even
at 1% this can be useful. ↩