Skip to content

emit SpanNode and TaskBlock events for critical-path analysis#11050

Draft
kaahos wants to merge 14 commits intomasterfrom
paul.fournillon/critical_path
Draft

emit SpanNode and TaskBlock events for critical-path analysis#11050
kaahos wants to merge 14 commits intomasterfrom
paul.fournillon/critical_path

Conversation

@kaahos
Copy link
Copy Markdown

@kaahos kaahos commented Apr 3, 2026

What Does This Do

Introduces two new JFR event types emitted by the Datadog profiler to capture the causal structure of traced requests:

  • SpanNode events, emitted on every span completion
  • TaskBlock events, emitted on every LockSupport.park() blocking interval that occurs under an active span
  • A LockSupportProfilingInstrumentation module that instruments LockSupport.park* / unpark to capture these edges.

Motivation

To improve latency attribution, critical-path analysis seems the way to go. It requires knowing which thread is the bottleneck for a given request at each point in time.

SpanNode and TaskBlock events together allow the backend to reconstruct the full execution DAG of a trace: SpanNode provides the span tree structure with precise timing, and TaskBlock provides the inter-thread wakeup edges (park -> unpark) needed to identify which thread is on the critical path.

LockSupport.park/unpark is the foundation of most JVM blocking primitives (ReentrantLock, CountDownLatch, CompletableFuture, virtual threads), so instrumenting it captures the majority of inter-thread handoffs in practice.

Additional Notes

Contributor Checklist

Jira ticket: PROF-12146

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels the queue request. /merge -f --reason "reason" skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.

@kaahos kaahos added type: feature request comp: profiling Profiling tag: ai generated Largely based on code generated by an AI or LLM labels Apr 3, 2026
@kaahos kaahos force-pushed the paul.fournillon/critical_path branch from c71d34c to 98a6fc9 Compare April 17, 2026 16:05
@kaahos kaahos force-pushed the paul.fournillon/critical_path branch 2 times, most recently from 898d9c3 to 46ebbf2 Compare April 18, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: profiling Profiling tag: ai generated Largely based on code generated by an AI or LLM type: feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant