Skip to content

Add AGP usage visibility for Gradle projects#11869

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
daniel.mohedano/agp-visibility
Jul 14, 2026
Merged

Add AGP usage visibility for Gradle projects#11869
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
daniel.mohedano/agp-visibility

Conversation

@daniel-mohedano

@daniel-mohedano daniel-mohedano commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

  • Implements additional visibility for session and module spans in Gradle projects making use of the Android Gradle Plugin. Our Gradle instrumentation will consider "Android Projects" those containing the com.android.base plugin in their used plugins.
    • New test.is_android tag is added to module spans and propagated to session spans with an OR operation.
    • New is_android boolean field on the event_finished telemetry metric.

Motivation

Together with #11852, the changes aim to provide better visibility for Android users using Test Optimization. In this case, it provides visibility on the overall Android user base, even if they don't use Robolectric emulation for unit tests.

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 (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: SDTEST-3887

@daniel-mohedano daniel-mohedano added type: feature Enhancements and improvements comp: ci visibility Continuous Integration Visibility labels Jul 6, 2026
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - sbt-scalatest

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 54.00 55.43 $\color{green}{\blacktriangledown}$ -1.43 54.33 $\color{green}{\blacktriangledown}$ -0.33 74/240
agentEvpProxy 52.80 n/a n/a n/a n/a -

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 6, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 12.50%
Overall Coverage: 56.58% (-0.47%)

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

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - pass4s

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 3.34 9.35 $\color{green}{\blacktriangledown}$ -6.01 10.33 $\color{green}{\blacktriangledown}$ -6.99 37/117
agentless 6.18 10.33 $\color{green}{\blacktriangledown}$ -4.15 10.13 $\color{green}{\blacktriangledown}$ -3.95 37/117
agentlessCodeCoverage 13.99 17.03 $\color{green}{\blacktriangledown}$ -3.04 17.73 $\color{green}{\blacktriangledown}$ -3.74 36/115

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - nebula-release-plugin

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 35.90 37.15 $\color{green}{\blacktriangledown}$ -1.25 36.42 $\color{green}{\blacktriangledown}$ -0.52 37/118
agentless 34.97 36.42 $\color{green}{\blacktriangledown}$ -1.45 36.42 $\color{green}{\blacktriangledown}$ -1.45 37/118
agentlessCodeCoverage 41.95 45.38 $\color{green}{\blacktriangledown}$ -3.43 44.48 $\color{green}{\blacktriangledown}$ -2.53 37/118
agentlessLineCoverage 74.15 74.82 $\color{green}{\blacktriangledown}$ -0.67 74.82 $\color{green}{\blacktriangledown}$ -0.67 36/117

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - reactive-streams-jvm

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 22.48 22.09 $\color{red}{\blacktriangle}$ +0.39 21.65 $\color{red}{\blacktriangle}$ +0.83 38/125
agentless 21.08 18.82 $\color{red}{\blacktriangle}$ +2.26 18.82 $\color{red}{\blacktriangle}$ +2.26 37/122
agentlessCodeCoverage 21.12 20.39 $\color{red}{\blacktriangle}$ +0.73 19.99 $\color{red}{\blacktriangle}$ +1.13 37/121
agentlessLineCoverage 31.18 29.82 $\color{red}{\blacktriangle}$ +1.36 29.82 $\color{red}{\blacktriangle}$ +1.36 36/120

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - netflix-zuul

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 88.68 87.80 $\color{red}{\blacktriangle}$ +0.88 87.80 $\color{red}{\blacktriangle}$ +0.88 38/125
agentless 84.74 81.05 $\color{red}{\blacktriangle}$ +3.69 81.05 $\color{red}{\blacktriangle}$ +3.69 38/124
agentlessCodeCoverage 97.30 97.04 $\color{red}{\blacktriangle}$ +0.26 95.12 $\color{red}{\blacktriangle}$ +2.18 38/122
agentlessLineCoverage 113.63 111.62 $\color{red}{\blacktriangle}$ +2.01 111.62 $\color{red}{\blacktriangle}$ +2.01 37/121

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@daniel-mohedano daniel-mohedano force-pushed the daniel.mohedano/agp-visibility branch from bec0bb1 to 2d4c049 Compare July 6, 2026 14:10
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - sonar-kotlin

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 12.58 12.87 $\color{green}{\blacktriangledown}$ -0.29 13.13 $\color{green}{\blacktriangledown}$ -0.55 33/116
agentless 10.05 11.88 $\color{green}{\blacktriangledown}$ -1.83 12.12 $\color{green}{\blacktriangledown}$ -2.07 33/115
agentlessCodeCoverage 12.78 15.11 $\color{green}{\blacktriangledown}$ -2.33 15.11 $\color{green}{\blacktriangledown}$ -2.33 33/115
agentlessLineCoverage 20.54 19.20 $\color{red}{\blacktriangle}$ +1.34 19.20 $\color{red}{\blacktriangle}$ +1.34 33/116

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - jolokia

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 93.91 95.12 $\color{green}{\blacktriangledown}$ -1.21 93.23 $\color{red}{\blacktriangle}$ +0.68 41/128
agentless 89.67 89.58 $\color{red}{\blacktriangle}$ +0.09 89.58 $\color{red}{\blacktriangle}$ +0.09 38/123
agentlessCodeCoverage 98.08 99.00 $\color{green}{\blacktriangledown}$ -0.92 99.00 $\color{green}{\blacktriangledown}$ -0.92 39/122
agentlessLineCoverage 99.91 99.00 $\color{red}{\blacktriangle}$ +0.91 99.00 $\color{red}{\blacktriangle}$ +0.91 37/120

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@dd-octo-sts

dd-octo-sts Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

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.97 s [-0.7%; +0.6%] (no difference)
startup:insecure-bank:tracing:Agent 12.98 s 13.01 s [-1.0%; +0.5%] (no difference)
startup:petclinic:appsec:Agent 16.84 s 16.82 s [-0.8%; +1.1%] (no difference)
startup:petclinic:iast:Agent 16.96 s 17.02 s [-1.2%; +0.5%] (no difference)
startup:petclinic:profiling:Agent 16.71 s 16.82 s [-1.7%; +0.4%] (no difference)
startup:petclinic:sca:Agent 16.94 s 16.87 s [-0.7%; +1.6%] (no difference)
startup:petclinic:tracing:Agent 16.11 s 16.13 s [-1.0%; +0.8%] (no difference)

Commit: 818bc4c9 · 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.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - okhttp

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 19.39 19.20 $\color{red}{\blacktriangle}$ +0.19 19.20 $\color{red}{\blacktriangle}$ +0.19 40/130
agentless 19.04 19.20 $\color{green}{\blacktriangledown}$ -0.16 19.20 $\color{green}{\blacktriangledown}$ -0.16 39/127
agentlessCodeCoverage 23.16 22.99 $\color{red}{\blacktriangle}$ +0.17 22.09 $\color{red}{\blacktriangle}$ +1.07 38/125
agentlessLineCoverage 47.24 44.48 $\color{red}{\blacktriangle}$ +2.76 44.48 $\color{red}{\blacktriangle}$ +2.76 36/130

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - spring_boot

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 15.58 16.36 $\color{green}{\blacktriangledown}$ -0.78 16.04 $\color{green}{\blacktriangledown}$ -0.46 38/117
agentless 8.95 9.73 $\color{green}{\blacktriangledown}$ -0.78 9.73 $\color{green}{\blacktriangledown}$ -0.78 38/118
agentlessCodeCoverage 12.97 13.67 $\color{green}{\blacktriangledown}$ -0.70 13.40 $\color{green}{\blacktriangledown}$ -0.43 38/116
agentlessLineCoverage 32.85 32.95 $\color{green}{\blacktriangledown}$ -0.10 32.95 $\color{green}{\blacktriangledown}$ -0.10 36/115

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - sonar-java

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 35.77 12.37 $\color{red}{\blacktriangle}$ +23.40 13.67 $\color{red}{\blacktriangle}$ +22.10 36/123
agentless -2.50 13.40 $\color{green}{\blacktriangledown}$ -15.90 16.04 $\color{green}{\blacktriangledown}$ -18.54 36/122
agentlessCodeCoverage 96.73 77.88 $\color{red}{\blacktriangle}$ +18.85 86.07 $\color{red}{\blacktriangle}$ +10.66 36/122
agentlessLineCoverage 122.95 130.99 $\color{green}{\blacktriangledown}$ -8.04 136.34 $\color{green}{\blacktriangledown}$ -13.39 35/121

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - heliboard

Job Status: 🟢 success

Scenario This PR (%) 7d median Δ 7d 30d median Δ 30d runs (7d/30d)
agent 10.65 9.54 $\color{red}{\blacktriangle}$ +1.11 9.54 $\color{red}{\blacktriangle}$ +1.11 35/39

Baseline: median of @test.tracer_overhead on main (gitlab) over the last 7/30 days, per OSS project & scenario. Δ = this PR − baseline median; red ▲ = more overhead, green ▽ = less overhead than baseline.

@daniel-mohedano

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b9bc56129

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@daniel-mohedano daniel-mohedano force-pushed the daniel.mohedano/android-robolectric branch from 30cee80 to 729666d Compare July 13, 2026 10:27
@daniel-mohedano daniel-mohedano force-pushed the daniel.mohedano/agp-visibility branch from 6b9bc56 to 1692771 Compare July 13, 2026 10:52
@daniel-mohedano daniel-mohedano marked this pull request as ready for review July 13, 2026 11:01
@daniel-mohedano daniel-mohedano requested review from a team as code owners July 13, 2026 11:01
@daniel-mohedano daniel-mohedano requested review from mhlidd and removed request for a team July 13, 2026 11:01

@datadog-datadog-us1-prod datadog-datadog-us1-prod Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

More details

The tag-read-after-span-finish pattern in AbstractTestModule.end() is safe: DDSpan.getTag() delegates to DDSpanContext.unsafeTags which is not cleared during finish, so span.getTag(TEST_IS_ANDROID) at line 122 reliably returns the Boolean.TRUE set during onTestModuleStart(). The Boolean::logicalOr merge spec, IsAndroid enum structure, and EVENT_FINISHED metric index expansion (1920→3840 entries, zero collisions) were all validated by synthetic execution against the production code logic.

Was this helpful? React 👍 or 👎

📊 Validated against 8 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 1692771 · What is Autotest? · Any feedback? Reach out in #autotest

Base automatically changed from daniel.mohedano/android-robolectric to master July 13, 2026 15:12
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot requested review from a team as code owners July 13, 2026 15:12
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot requested review from AlexeyKuznetsov-DD and removed request for a team July 13, 2026 15:12
Detect Android Gradle Plugin projects at the build-system level and surface
an is_android signal independent of the test runner:
- test.is_android span tag on the build-system module, rolled up to the
  session via the tag propagator
- IsAndroid dimension on the EVENT_FINISHED telemetry metric
- detection via com.android.base and com.android.kotlin.multiplatform.library
  (the KMP library plugin, AGP 8.8+, does not apply com.android.base)

Exercised by the Robolectric Gradle smoke test through a com.android.base
stand-in plugin.
@daniel-mohedano daniel-mohedano force-pushed the daniel.mohedano/agp-visibility branch from 1692771 to 818bc4c Compare July 14, 2026 08:05
@daniel-mohedano

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 14, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-14 13:13:23 UTC ℹ️ Start processing command /merge


2026-07-14 13:13:28 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-07-14 15:09:35 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 58f636d into master Jul 14, 2026
584 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the daniel.mohedano/agp-visibility branch July 14, 2026 15:09
@github-actions github-actions Bot added this to the 1.65.0 milestone Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: ci visibility Continuous Integration Visibility type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants