-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
tracing: centralized span registry #61407
Comments
Thanks for the writeup (and prototype) @irfansharif — very nice to have! |
I also want to link #60784 as a related PR whose stated functionality will work as expected once we have a centralized span registry. Currently the builtin added is called Once this is fixed, we will likely need to make a change to #60922 |
Filed #62020 following our discussions from last week. |
I'm tying up loose ends as I offboard this week, and unassigning myself for now. I'll be eagerly following along any subsequent changes 😄 |
Ah, additionally, wanted to note this comment in a PR I am about to close off — #61694 (review) — @irfansharif mentions that we actually will still need the in-memory graph structure to power session tracing. |
We're unlikely to do anything with this anytime soon. Especially now that traces are only created for sampled statements (#61777), we have a global knob to tune how much memory tracing uses. |
Describe the problem
The registry of inflight spans today only captures root spans. We construct an in-memory tree of child spans that derive from the parent spans, and are thus only accessible through tree traversal. This makes a few things more cumbersome, compared to the alternative (below).
cockroach/pkg/util/tracing/tracer.go
Lines 121 to 141 in 5b72a34
cockroach/pkg/util/tracing/crdbspan.go
Lines 74 to 76 in 5b72a34
Proposed improvement
We can centralize the storage of spans by storing them directly in the same in-memory registry (keyed by Span ID) and have parent spans only refer to child spans by IDs, rather than direct pointers. See #59310 for a prototype of what that could look like.
It comes with a few upsides.
The text was updated successfully, but these errors were encountered: