Repository navigation
fix(profiling): clear finished span links - #19341
Merged
taegyunkim merged 0 commit intoAug 5, 2026
Merged
taegyunkim merged 0 commit into
taegyunkim merged 0 commit into
Conversation
Codeowners resolved as |
Circular import analysis
|
|
taegyunkim
force-pushed
the
taegyunkim/profiling-clear-finished-endpoint
branch
from
July 29, 2026 17:30
7629ec0 to
e9d510e
Compare
taegyunkim
changed the base branch from
main
to
taegyunkim/profiling-gevent-span-links
July 29, 2026 17:32
taegyunkim
force-pushed
the
taegyunkim/profiling-clear-finished-endpoint
branch
from
July 29, 2026 17:38
e9d510e to
c5a8f30
Compare
taegyunkim
force-pushed
the
taegyunkim/profiling-gevent-span-links
branch
2 times, most recently
from
July 29, 2026 18:23
3eefb90 to
1694041
Compare
taegyunkim
force-pushed
the
taegyunkim/profiling-clear-finished-endpoint
branch
3 times, most recently
from
July 30, 2026 20:56
4015c0e to
9a412ec
Compare
taegyunkim
changed the base branch from
taegyunkim/profiling-gevent-span-links
to
taegyunkim/profiling-logical-span-links
July 30, 2026 20:56
taegyunkim
force-pushed
the
taegyunkim/profiling-clear-finished-endpoint
branch
2 times, most recently
from
July 30, 2026 21:31
6b72027 to
658892c
Compare
This was referenced Jul 30, 2026
taegyunkim
force-pushed
the
taegyunkim/profiling-logical-span-links
branch
from
August 5, 2026 17:01
dab384f to
afadd01
Compare
taegyunkim
force-pushed
the
taegyunkim/profiling-clear-finished-endpoint
branch
from
August 5, 2026 17:01
658892c to
c500e46
Compare
taegyunkim
force-pushed
the
taegyunkim/profiling-logical-span-links
branch
from
August 5, 2026 17:13
afadd01 to
1153d8b
Compare
taegyunkim
force-pushed
the
taegyunkim/profiling-clear-finished-endpoint
branch
from
August 5, 2026 17:13
c500e46 to
615d186
Compare
taegyunkim
force-pushed
the
taegyunkim/profiling-logical-span-links
branch
from
August 5, 2026 17:16
1153d8b to
ca6945c
Compare
taegyunkim
force-pushed
the
taegyunkim/profiling-clear-finished-endpoint
branch
2 times, most recently
from
August 5, 2026 17:56
e121905 to
b47705e
Compare
taegyunkim
force-pushed
the
taegyunkim/profiling-logical-span-links
branch
from
August 5, 2026 17:56
ca6945c to
e50fe98
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR is stacked on #19420.
Fixes stale stack-profiler attribution after a trace finishes and adds the shared activation and lifecycle layer used by the gevent and asyncio follow-ups.
Activation routing
ContextVar, allowing newly created logical contexts to inherit attribution without retaining aSpan.Cleanup and process lifecycle
ThreadSpanLinksowns the forward and reverse indexes under one native mutex. Finishing a span atomically removes every current target whose span or local root derives from it. If a target has already advanced to another span, the reverse index no longer associates it with the finished span, so cleanup preserves the newer mapping.Profiler enable, disable, restart, and post-fork hooks clear native mappings and invalidate generation-scoped ContextVar state. No physical or logical span attribution crosses a fork. Only a real activation in the child can create a new link.
Observability and resource bounds
profiler.span_links.droppedtelemetry counters for provider failures and integration-supplied conservative rejection reasons.profiler.span_linksgauges by target domain at profiler flush time.Testing
Added coverage for:
Validation completed:
10 passedin each mode326 passed, 86 skipped, 2 xpassedin each modescripts/lintscripts/lint cformatscripts/lint profiling-native-checkgit diff --checkRisks
Additional Notes