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-mohedanodaniel-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-mohedanodaniel-mohedano added type: feature Enhancements and improvements comp: ci visibility Continuous Integration Visibility labels Jul 6, 2026
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - sbt-scalatest

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent54.0055.43$\color{green}{\blacktriangledown}$ -1.4354.33$\color{green}{\blacktriangledown}$ -0.3374/240
agentEvpProxy52.80n/an/an/an/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-prodBot 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-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - pass4s

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent3.349.35$\color{green}{\blacktriangledown}$ -6.0110.33$\color{green}{\blacktriangledown}$ -6.9937/117
agentless6.1810.33$\color{green}{\blacktriangledown}$ -4.1510.13$\color{green}{\blacktriangledown}$ -3.9537/117
agentlessCodeCoverage13.9917.03$\color{green}{\blacktriangledown}$ -3.0417.73$\color{green}{\blacktriangledown}$ -3.7436/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-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - nebula-release-plugin

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent35.9037.15$\color{green}{\blacktriangledown}$ -1.2536.42$\color{green}{\blacktriangledown}$ -0.5237/118
agentless34.9736.42$\color{green}{\blacktriangledown}$ -1.4536.42$\color{green}{\blacktriangledown}$ -1.4537/118
agentlessCodeCoverage41.9545.38$\color{green}{\blacktriangledown}$ -3.4344.48$\color{green}{\blacktriangledown}$ -2.5337/118
agentlessLineCoverage74.1574.82$\color{green}{\blacktriangledown}$ -0.6774.82$\color{green}{\blacktriangledown}$ -0.6736/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-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - reactive-streams-jvm

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent22.4822.09$\color{red}{\blacktriangle}$ +0.3921.65$\color{red}{\blacktriangle}$ +0.8338/125
agentless21.0818.82$\color{red}{\blacktriangle}$ +2.2618.82$\color{red}{\blacktriangle}$ +2.2637/122
agentlessCodeCoverage21.1220.39$\color{red}{\blacktriangle}$ +0.7319.99$\color{red}{\blacktriangle}$ +1.1337/121
agentlessLineCoverage31.1829.82$\color{red}{\blacktriangle}$ +1.3629.82$\color{red}{\blacktriangle}$ +1.3636/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-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - netflix-zuul

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent88.6887.80$\color{red}{\blacktriangle}$ +0.8887.80$\color{red}{\blacktriangle}$ +0.8838/125
agentless84.7481.05$\color{red}{\blacktriangle}$ +3.6981.05$\color{red}{\blacktriangle}$ +3.6938/124
agentlessCodeCoverage97.3097.04$\color{red}{\blacktriangle}$ +0.2695.12$\color{red}{\blacktriangle}$ +2.1838/122
agentlessLineCoverage113.63111.62$\color{red}{\blacktriangle}$ +2.01111.62$\color{red}{\blacktriangle}$ +2.0137/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-mohedanoforce-pushed the daniel.mohedano/agp-visibility branch from bec0bb1 to 2d4c049CompareJuly 6, 2026 14:10
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - sonar-kotlin

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent12.5812.87$\color{green}{\blacktriangledown}$ -0.2913.13$\color{green}{\blacktriangledown}$ -0.5533/116
agentless10.0511.88$\color{green}{\blacktriangledown}$ -1.8312.12$\color{green}{\blacktriangledown}$ -2.0733/115
agentlessCodeCoverage12.7815.11$\color{green}{\blacktriangledown}$ -2.3315.11$\color{green}{\blacktriangledown}$ -2.3333/115
agentlessLineCoverage20.5419.20$\color{red}{\blacktriangle}$ +1.3419.20$\color{red}{\blacktriangle}$ +1.3433/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-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - jolokia

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent93.9195.12$\color{green}{\blacktriangledown}$ -1.2193.23$\color{red}{\blacktriangle}$ +0.6841/128
agentless89.6789.58$\color{red}{\blacktriangle}$ +0.0989.58$\color{red}{\blacktriangle}$ +0.0938/123
agentlessCodeCoverage98.0899.00$\color{green}{\blacktriangledown}$ -0.9299.00$\color{green}{\blacktriangledown}$ -0.9239/122
agentlessLineCoverage99.9199.00$\color{red}{\blacktriangle}$ +0.9199.00$\color{red}{\blacktriangle}$ +0.9137/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-stsBot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

SuiteStatus
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
ScenarioCandidatemasterΔ (95% CI of mean)
startup:insecure-bank:iast:Agent13.96 s13.97 s[-0.7%; +0.6%] (no difference)
startup:insecure-bank:tracing:Agent12.98 s13.01 s[-1.0%; +0.5%] (no difference)
startup:petclinic:appsec:Agent16.84 s16.82 s[-0.8%; +1.1%] (no difference)
startup:petclinic:iast:Agent16.96 s17.02 s[-1.2%; +0.5%] (no difference)
startup:petclinic:profiling:Agent16.71 s16.82 s[-1.7%; +0.4%] (no difference)
startup:petclinic:sca:Agent16.94 s16.87 s[-0.7%; +1.6%] (no difference)
startup:petclinic:tracing:Agent16.11 s16.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-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - okhttp

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent19.3919.20$\color{red}{\blacktriangle}$ +0.1919.20$\color{red}{\blacktriangle}$ +0.1940/130
agentless19.0419.20$\color{green}{\blacktriangledown}$ -0.1619.20$\color{green}{\blacktriangledown}$ -0.1639/127
agentlessCodeCoverage23.1622.99$\color{red}{\blacktriangle}$ +0.1722.09$\color{red}{\blacktriangle}$ +1.0738/125
agentlessLineCoverage47.2444.48$\color{red}{\blacktriangle}$ +2.7644.48$\color{red}{\blacktriangle}$ +2.7636/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-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - spring_boot

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent15.5816.36$\color{green}{\blacktriangledown}$ -0.7816.04$\color{green}{\blacktriangledown}$ -0.4638/117
agentless8.959.73$\color{green}{\blacktriangledown}$ -0.789.73$\color{green}{\blacktriangledown}$ -0.7838/118
agentlessCodeCoverage12.9713.67$\color{green}{\blacktriangledown}$ -0.7013.40$\color{green}{\blacktriangledown}$ -0.4338/116
agentlessLineCoverage32.8532.95$\color{green}{\blacktriangledown}$ -0.1032.95$\color{green}{\blacktriangledown}$ -0.1036/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-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - sonar-java

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent35.7712.37$\color{red}{\blacktriangle}$ +23.4013.67$\color{red}{\blacktriangle}$ +22.1036/123
agentless-2.5013.40$\color{green}{\blacktriangledown}$ -15.9016.04$\color{green}{\blacktriangledown}$ -18.5436/122
agentlessCodeCoverage96.7377.88$\color{red}{\blacktriangle}$ +18.8586.07$\color{red}{\blacktriangle}$ +10.6636/122
agentlessLineCoverage122.95130.99$\color{green}{\blacktriangledown}$ -8.04136.34$\color{green}{\blacktriangledown}$ -13.3935/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-54b7daBot commented Jul 6, 2026

Copy link
Copy Markdown

Test Environment - heliboard

Job Status: 🟢 success

ScenarioThis PR (%)7d medianΔ 7d30d medianΔ 30druns (7d/30d)
agent10.659.54$\color{red}{\blacktriangle}$ +1.119.54$\color{red}{\blacktriangle}$ +1.1135/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
ContributorAuthor

@codex review

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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-mohedanoforce-pushed the daniel.mohedano/android-robolectric branch from 30cee80 to 729666dCompareJuly 13, 2026 10:27
@daniel-mohedano
daniel-mohedanoforce-pushed the daniel.mohedano/agp-visibility branch from 6b9bc56 to 1692771CompareJuly 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 ownersJuly 13, 2026 11:01
@daniel-mohedano
daniel-mohedano requested review from mhlidd and removed request for a teamJuly 13, 2026 11:01

@datadog-datadog-us1-proddatadog-datadog-us1-prodBot 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 masterJuly 13, 2026 15:12
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854dBot requested review from AlexeyKuznetsov-DD and removed request for a teamJuly 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-mohedanoforce-pushed the daniel.mohedano/agp-visibility branch from 1692771 to 818bc4cCompareJuly 14, 2026 08:05
@daniel-mohedano

Copy link
Copy Markdown
ContributorAuthor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351Bot 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-cf854dBot merged commit 58f636d into masterJul 14, 2026
584 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854dBot deleted the daniel.mohedano/agp-visibility branch July 14, 2026 15:09
@github-actionsgithub-actionsBot added this to the 1.65.0 milestone Jul 14, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: ci visibilityContinuous Integration Visibilitytype: featureEnhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@daniel-mohedano@ypopovych