Skip to content

Add wallclock TaskBlock profiler support#11544

Draft
kaahos wants to merge 9 commits into
masterfrom
paul.fournillon/wallclock-taskblock
Draft

Add wallclock TaskBlock profiler support#11544
kaahos wants to merge 9 commits into
masterfrom
paul.fournillon/wallclock-taskblock

Conversation

@kaahos

@kaahos kaahos commented Jun 3, 2026

Copy link
Copy Markdown

What Does This Do

Add support for wall-clock TaskBlock events, including span-context attribution and native event recording for blocking intervals such as Object.wait and synchronized contention.

Motivation

Make blocking time visible as structured datadog.TaskBlock events instead of relying only on sampled wall-clock frames. It allows to reduce signal emissions.

Additional Notes

Foundation for follow-up LockSupport and Thread.sleep TaskBlock instrumentation.

This PR depends on PR #570 from java-profiler, which adds the new TaskBlock event emission as well as I/O instrumentation.

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level
    • Get more information in this doc

Jira ticket: [PROF-15320](https://datadoghq.atlassian.net/browse/PROF-15320)

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 22.22%
Overall Coverage: 56.88% (-0.06%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: df2f481 | Docs | Datadog PR Page | Give us feedback!

Comment thread .gitlab-ci.yml

JAVA_PROFILER_REF:
description: "When non-empty, clone DataDog/java-profiler at this Git ref (branch or tag), build ddprof, and use it as ddprof.jar for Gradle jobs instead of the Maven dependency."
value: "paul.fournillon/wallclock-taskblock"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Sphinx Review — HIGH] JAVA_PROFILER_REF defaults to a personal feature branch ('paul.fournillon/wallclock-taskblock'). The build_java_profiler_ddprof job fires whenever the value is non-empty, so by default the entire pipeline builds and injects ddprof from this personal branch instead of the published artifact. This includes deploy_to_maven_central and deploy_snapshot_with_ddprof_snapshot. If the personal branch is deleted, force-pushed, or renamed, 'git clone --branch' fails and breaks all builds.

Suggestion: Set the default value to an empty string before merge (keep the override mechanism for ad-hoc testing). Apply the same change to env JAVA_PROFILER_REF in .github/workflows/run-system-tests.yaml.

[CONSENSUS · confidence: high · adversary-tested]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is definitely not something we want to keep in the end. I've made these temporary changes so the CI tests can run smoothly while working on this PR: it avoids facing build issues that can hide real regression bugs. Before this PR is merged, both .gitlab-ci.yml and .github/workflows will be reset to their original state.

Comment thread .gitlab-ci.yml
mkdir -p "${CI_PROJECT_DIR}/custom-ddprof"
SRCDIR="${CI_PROJECT_DIR}/java-profiler-src"
rm -rf "$SRCDIR"
git clone --depth 1 --branch "$JAVA_PROFILER_REF" https://github.com/DataDog/java-profiler.git "$SRCDIR"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Sphinx Review — MEDIUM] External java-profiler clone is pinned only to a mutable branch ref (--branch $JAVA_PROFILER_REF --depth 1) with no commit SHA. The produced ddprof.jar is injected into downstream jobs including deploy_to_maven_central and deploy_snapshot_with_ddprof_snapshot, with no reproducibility or supply-chain integrity guarantee. Any force-push to the branch silently changes the artifact without a CI diff.

Suggestion: Require a commit SHA (or signed tag) rather than a branch for the ref, or restrict the custom-build path to non-publish pipelines. At minimum, exclude build_java_profiler_ddprof from deploy_to_maven_central / deploy_snapshot needs so a custom build can never reach a release.

[concern: security · confidence: medium]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above!

@dd-octo-sts

dd-octo-sts Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🔴 Java Benchmark SLOs — Performance SLO breach detected

Suite Status
Startup 🔴 breach

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.96 s 13.88 s [-0.1%; +1.3%] (no difference)
startup:insecure-bank:tracing:Agent 12.90 s 13.03 s [-1.7%; -0.3%] (maybe better)
startup:petclinic:appsec:Agent 16.85 s 16.11 s [+0.2%; +9.2%] (maybe worse)
startup:petclinic:iast:Agent 16.71 s 16.93 s [-2.0%; -0.5%] (maybe better)
startup:petclinic:profiling:Agent 16.56 s 16.72 s [-2.0%; +0.1%] (no difference)
startup:petclinic:sca:Agent 16.82 s 16.18 s [-0.4%; +8.3%] (no difference)
startup:petclinic:tracing:Agent 16.10 s 15.71 s [-1.7%; +6.7%] (no difference)

Commit: df2f481c · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@kaahos kaahos force-pushed the paul.fournillon/wallclock-taskblock branch from 95fc3a3 to df2f481 Compare July 6, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants