Implement Bazel support for CI Visibility#11150
Implement Bazel support for CI Visibility#11150gh-worker-dd-mergequeue-cf854d[bot] merged 18 commits intomasterfrom
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 61 metrics, 9 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.62.0-SNAPSHOT~30c479b168, baseline=1.62.0-SNAPSHOT~34333bb5c3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.056 s) : 0, 1056007
Total [baseline] (8.843 s) : 0, 8842933
Agent [candidate] (1.059 s) : 0, 1058784
Total [candidate] (8.865 s) : 0, 8864927
section iast
Agent [baseline] (1.237 s) : 0, 1237437
Total [baseline] (9.522 s) : 0, 9521590
Agent [candidate] (1.242 s) : 0, 1241851
Total [candidate] (9.573 s) : 0, 9572631
gantt
title insecure-bank - break down per module: candidate=1.62.0-SNAPSHOT~30c479b168, baseline=1.62.0-SNAPSHOT~34333bb5c3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.242 ms) : 0, 1242
crashtracking [candidate] (1.244 ms) : 0, 1244
BytebuddyAgent [baseline] (635.306 ms) : 0, 635306
BytebuddyAgent [candidate] (636.086 ms) : 0, 636086
AgentMeter [baseline] (29.574 ms) : 0, 29574
AgentMeter [candidate] (29.7 ms) : 0, 29700
GlobalTracer [baseline] (248.778 ms) : 0, 248778
GlobalTracer [candidate] (250.034 ms) : 0, 250034
AppSec [baseline] (32.387 ms) : 0, 32387
AppSec [candidate] (32.461 ms) : 0, 32461
Debugger [baseline] (59.508 ms) : 0, 59508
Debugger [candidate] (59.704 ms) : 0, 59704
Remote Config [baseline] (618.952 µs) : 0, 619
Remote Config [candidate] (592.998 µs) : 0, 593
Telemetry [baseline] (8.765 ms) : 0, 8765
Telemetry [candidate] (8.331 ms) : 0, 8331
Flare Poller [baseline] (3.548 ms) : 0, 3548
Flare Poller [candidate] (4.369 ms) : 0, 4369
section iast
crashtracking [baseline] (1.233 ms) : 0, 1233
crashtracking [candidate] (1.245 ms) : 0, 1245
BytebuddyAgent [baseline] (812.844 ms) : 0, 812844
BytebuddyAgent [candidate] (818.534 ms) : 0, 818534
AgentMeter [baseline] (11.49 ms) : 0, 11490
AgentMeter [candidate] (11.53 ms) : 0, 11530
GlobalTracer [baseline] (240.999 ms) : 0, 240999
GlobalTracer [candidate] (240.55 ms) : 0, 240550
IAST [baseline] (31.955 ms) : 0, 31955
IAST [candidate] (30.144 ms) : 0, 30144
AppSec [baseline] (26.699 ms) : 0, 26699
AppSec [candidate] (29.128 ms) : 0, 29128
Debugger [baseline] (64.324 ms) : 0, 64324
Debugger [candidate] (62.694 ms) : 0, 62694
Remote Config [baseline] (533.727 µs) : 0, 534
Remote Config [candidate] (531.408 µs) : 0, 531
Telemetry [baseline] (7.796 ms) : 0, 7796
Telemetry [candidate] (7.991 ms) : 0, 7991
Flare Poller [baseline] (3.412 ms) : 0, 3412
Flare Poller [candidate] (3.421 ms) : 0, 3421
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.62.0-SNAPSHOT~30c479b168, baseline=1.62.0-SNAPSHOT~34333bb5c3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1057434
Total [baseline] (11.127 s) : 0, 11127349
Agent [candidate] (1.063 s) : 0, 1062997
Total [candidate] (11.103 s) : 0, 11102585
section appsec
Agent [baseline] (1.26 s) : 0, 1259796
Total [baseline] (11.08 s) : 0, 11079788
Agent [candidate] (1.269 s) : 0, 1268919
Total [candidate] (10.987 s) : 0, 10987193
section iast
Agent [baseline] (1.234 s) : 0, 1234022
Total [baseline] (11.349 s) : 0, 11348553
Agent [candidate] (1.241 s) : 0, 1240709
Total [candidate] (11.32 s) : 0, 11319534
section profiling
Agent [baseline] (1.184 s) : 0, 1184393
Total [baseline] (10.934 s) : 0, 10934247
Agent [candidate] (1.182 s) : 0, 1181968
Total [candidate] (11.084 s) : 0, 11083723
gantt
title petclinic - break down per module: candidate=1.62.0-SNAPSHOT~30c479b168, baseline=1.62.0-SNAPSHOT~34333bb5c3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.231 ms) : 0, 1231
crashtracking [candidate] (1.233 ms) : 0, 1233
BytebuddyAgent [baseline] (635.774 ms) : 0, 635774
BytebuddyAgent [candidate] (638.285 ms) : 0, 638285
AgentMeter [baseline] (29.484 ms) : 0, 29484
AgentMeter [candidate] (29.748 ms) : 0, 29748
GlobalTracer [baseline] (248.644 ms) : 0, 248644
GlobalTracer [candidate] (249.932 ms) : 0, 249932
AppSec [baseline] (32.19 ms) : 0, 32190
AppSec [candidate] (32.458 ms) : 0, 32458
Debugger [baseline] (60.302 ms) : 0, 60302
Debugger [candidate] (60.861 ms) : 0, 60861
Remote Config [baseline] (592.927 µs) : 0, 593
Remote Config [candidate] (594.118 µs) : 0, 594
Telemetry [baseline] (8.764 ms) : 0, 8764
Telemetry [candidate] (8.432 ms) : 0, 8432
Flare Poller [baseline] (4.254 ms) : 0, 4254
Flare Poller [candidate] (5.104 ms) : 0, 5104
section appsec
crashtracking [baseline] (1.218 ms) : 0, 1218
crashtracking [candidate] (1.221 ms) : 0, 1221
BytebuddyAgent [baseline] (673.623 ms) : 0, 673623
BytebuddyAgent [candidate] (679.051 ms) : 0, 679051
AgentMeter [baseline] (12.239 ms) : 0, 12239
AgentMeter [candidate] (12.385 ms) : 0, 12385
GlobalTracer [baseline] (248.64 ms) : 0, 248640
GlobalTracer [candidate] (250.405 ms) : 0, 250405
IAST [baseline] (24.166 ms) : 0, 24166
IAST [candidate] (24.355 ms) : 0, 24355
AppSec [baseline] (185.934 ms) : 0, 185934
AppSec [candidate] (187.891 ms) : 0, 187891
Debugger [baseline] (65.798 ms) : 0, 65798
Debugger [candidate] (64.916 ms) : 0, 64916
Remote Config [baseline] (587.674 µs) : 0, 588
Remote Config [candidate] (569.398 µs) : 0, 569
Telemetry [baseline] (7.9 ms) : 0, 7900
Telemetry [candidate] (8.109 ms) : 0, 8109
Flare Poller [baseline] (3.454 ms) : 0, 3454
Flare Poller [candidate] (3.464 ms) : 0, 3464
section iast
crashtracking [baseline] (1.232 ms) : 0, 1232
crashtracking [candidate] (1.25 ms) : 0, 1250
BytebuddyAgent [baseline] (810.567 ms) : 0, 810567
BytebuddyAgent [candidate] (815.854 ms) : 0, 815854
AgentMeter [baseline] (11.379 ms) : 0, 11379
AgentMeter [candidate] (11.565 ms) : 0, 11565
GlobalTracer [baseline] (239.817 ms) : 0, 239817
GlobalTracer [candidate] (239.19 ms) : 0, 239190
IAST [baseline] (30.889 ms) : 0, 30889
IAST [candidate] (30.154 ms) : 0, 30154
AppSec [baseline] (27.478 ms) : 0, 27478
AppSec [candidate] (30.532 ms) : 0, 30532
Debugger [baseline] (64.959 ms) : 0, 64959
Debugger [candidate] (63.724 ms) : 0, 63724
Remote Config [baseline] (539.478 µs) : 0, 539
Remote Config [candidate] (541.368 µs) : 0, 541
Telemetry [baseline] (7.766 ms) : 0, 7766
Telemetry [candidate] (8.192 ms) : 0, 8192
Flare Poller [baseline] (3.387 ms) : 0, 3387
Flare Poller [candidate] (3.48 ms) : 0, 3480
section profiling
crashtracking [baseline] (1.19 ms) : 0, 1190
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (691.415 ms) : 0, 691415
BytebuddyAgent [candidate] (689.56 ms) : 0, 689560
AgentMeter [baseline] (8.936 ms) : 0, 8936
AgentMeter [candidate] (8.913 ms) : 0, 8913
GlobalTracer [baseline] (207.468 ms) : 0, 207468
GlobalTracer [candidate] (207.218 ms) : 0, 207218
AppSec [baseline] (32.62 ms) : 0, 32620
AppSec [candidate] (32.441 ms) : 0, 32441
Debugger [baseline] (65.649 ms) : 0, 65649
Debugger [candidate] (65.665 ms) : 0, 65665
Remote Config [baseline] (576.85 µs) : 0, 577
Remote Config [candidate] (565.526 µs) : 0, 566
Telemetry [baseline] (7.776 ms) : 0, 7776
Telemetry [candidate] (7.983 ms) : 0, 7983
Flare Poller [baseline] (3.504 ms) : 0, 3504
Flare Poller [candidate] (3.499 ms) : 0, 3499
ProfilingAgent [baseline] (93.58 ms) : 0, 93580
ProfilingAgent [candidate] (93.416 ms) : 0, 93416
Profiling [baseline] (94.145 ms) : 0, 94145
Profiling [candidate] (93.967 ms) : 0, 93967
LoadParameters
See matching parameters
SummaryFound 3 performance improvements and 2 performance regressions! Performance is the same for 14 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~30c479b168, baseline=1.62.0-SNAPSHOT~34333bb5c3
dateFormat X
axisFormat %s
section baseline
no_agent (1.259 ms) : 1246, 1271
. : milestone, 1259,
iast (3.34 ms) : 3296, 3384
. : milestone, 3340,
iast_FULL (6.183 ms) : 6118, 6247
. : milestone, 6183,
iast_GLOBAL (3.651 ms) : 3596, 3706
. : milestone, 3651,
profiling (2.235 ms) : 2215, 2256
. : milestone, 2235,
tracing (1.903 ms) : 1886, 1920
. : milestone, 1903,
section candidate
no_agent (1.25 ms) : 1237, 1262
. : milestone, 1250,
iast (3.391 ms) : 3340, 3442
. : milestone, 3391,
iast_FULL (6.094 ms) : 6032, 6156
. : milestone, 6094,
iast_GLOBAL (3.69 ms) : 3628, 3753
. : milestone, 3690,
profiling (2.249 ms) : 2228, 2271
. : milestone, 2249,
tracing (1.918 ms) : 1902, 1935
. : milestone, 1918,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~30c479b168, baseline=1.62.0-SNAPSHOT~34333bb5c3
dateFormat X
axisFormat %s
section baseline
no_agent (19.309 ms) : 19110, 19508
. : milestone, 19309,
appsec (19.068 ms) : 18874, 19262
. : milestone, 19068,
code_origins (19.113 ms) : 18925, 19300
. : milestone, 19113,
iast (17.935 ms) : 17759, 18111
. : milestone, 17935,
profiling (18.39 ms) : 18209, 18571
. : milestone, 18390,
tracing (18.074 ms) : 17894, 18253
. : milestone, 18074,
section candidate
no_agent (17.323 ms) : 17149, 17497
. : milestone, 17323,
appsec (18.765 ms) : 18580, 18951
. : milestone, 18765,
code_origins (17.867 ms) : 17693, 18042
. : milestone, 17867,
iast (18.95 ms) : 18758, 19142
. : milestone, 18950,
profiling (18.284 ms) : 18100, 18467
. : milestone, 18284,
tracing (17.946 ms) : 17769, 18123
. : milestone, 17946,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~30c479b168, baseline=1.62.0-SNAPSHOT~34333bb5c3
dateFormat X
axisFormat %s
section baseline
no_agent (1.486 ms) : 1474, 1498
. : milestone, 1486,
appsec (2.548 ms) : 2493, 2604
. : milestone, 2548,
iast (2.284 ms) : 2214, 2354
. : milestone, 2284,
iast_GLOBAL (2.331 ms) : 2260, 2402
. : milestone, 2331,
profiling (2.097 ms) : 2042, 2152
. : milestone, 2097,
tracing (2.098 ms) : 2044, 2153
. : milestone, 2098,
section candidate
no_agent (1.484 ms) : 1472, 1495
. : milestone, 1484,
appsec (3.843 ms) : 3621, 4065
. : milestone, 3843,
iast (2.292 ms) : 2222, 2363
. : milestone, 2292,
iast_GLOBAL (2.33 ms) : 2259, 2401
. : milestone, 2330,
profiling (2.107 ms) : 2051, 2162
. : milestone, 2107,
tracing (2.084 ms) : 2030, 2138
. : milestone, 2084,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~30c479b168, baseline=1.62.0-SNAPSHOT~34333bb5c3
dateFormat X
axisFormat %s
section baseline
no_agent (15.537 s) : 15537000, 15537000
. : milestone, 15537000,
appsec (14.977 s) : 14977000, 14977000
. : milestone, 14977000,
iast (18.165 s) : 18165000, 18165000
. : milestone, 18165000,
iast_GLOBAL (18.253 s) : 18253000, 18253000
. : milestone, 18253000,
profiling (15.609 s) : 15609000, 15609000
. : milestone, 15609000,
tracing (14.744 s) : 14744000, 14744000
. : milestone, 14744000,
section candidate
no_agent (15.156 s) : 15156000, 15156000
. : milestone, 15156000,
appsec (14.649 s) : 14649000, 14649000
. : milestone, 14649000,
iast (17.912 s) : 17912000, 17912000
. : milestone, 17912000,
iast_GLOBAL (17.907 s) : 17907000, 17907000
. : milestone, 17907000,
profiling (15.255 s) : 15255000, 15255000
. : milestone, 15255000,
tracing (15.02 s) : 15020000, 15020000
. : milestone, 15020000,
|
Test Environment - sbt-scalatestJob Status: success
|
Test Environment - nebula-release-pluginJob Status: success
|
Test Environment - reactive-streams-jvmJob Status: success
|
Test Environment - netflix-zuulJob Status: success
|
Test Environment - pass4sJob Status: success
|
Test Environment - sonar-kotlinJob Status: success
|
Test Environment - jolokiaJob Status: success
|
Test Environment - okhttpJob Status: success
|
Test Environment - spring_bootJob Status: success
|
Test Environment - sonar-javaJob Status: success
|
sarahchen6
left a comment
There was a problem hiding this comment.
Looks good on the LP end!
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
The merge request has been interrupted because the build 0 took longer than expected. The current limit for the base branch 'master' is 120 minutes. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
This PR is rejected because it was updated |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Adds Bazel-focused CI Visibility support with two offline execution modes, mirroring dd-trace-go#4503 and dd-trace-py#17197:
DD_TEST_OPTIMIZATION_MANIFEST_FILE): reads settings, known tests, flaky tests, and test management data from pre-fetched JSON cache files instead of hitting the backend.DD_TEST_OPTIMIZATION_PAYLOADS_IN_FILES): writes CI test cycle, coverage, and tracer telemetry to$TEST_UNDECLARED_OUTPUTS_DIR/payloads/{tests,coverage,telemetry}/*.jsoninstead of POSTing them.Key Changes
BazelMode(internal-api): detects both modes, resolves the manifest path via Bazel's rlocation algorithm, parses theversion=<int>header, and exposes thetests/,coverage/, andtelemetry/output directories.FileBasedConfigurationApi(agent-ci-visibility): reads the same JSON envelopes as the HTTP API from disk; null paths return safe defaults.FileBasedPayloadDispatcher(dd-trace-core): serializes CI test cycle and coverage spans as JSON files; stripsci.*/git.*/runtime.*/os.*tags to avoid cache invalidation; atomic temp-file + rename. Writestrace_id/span_id/parent_idas unsigned 64-bit JSON numbers (not strings) so backend schema validation passes.FileBasedTelemetryClient(telemetry): subclass ofTelemetryClientthat writes the existing Moshi-encoded telemetry request body to a file;TelemetryRoutergets a single-client path that skips feature discovery;TelemetrySystemswaps in the file-based client when Bazel mode is active.WriterFactory/CiVisibilityServices/CiVisibilityRepoServices: wire the file-based dispatcher/config API, disable the git client, and skip git-data upload when Bazel mode is active.CoreTracer: in Bazel payload-files mode, usesStreamingTraceCollector(streams each CI Visibility span individually) andDDIntakeTraceInterceptor(not the APM-protocol interceptor, which stripstest_{session,module,suite}_endspans) — same treatment as agentless, so all CITESTCYCLE events reach the file dispatcher.JUnit4TracingListener/JUnit4Utils: lazy-register the test suite intestStartedso runners that don't firetestSuiteStartedstill produce a proper suite span; unwrapcom.google.testing.junit.junit4.runner.RunNotifierWrapperinrunListenersFromRunNotifierso the idempotency check sees listeners installed on the inner notifier (fixes duplicate-listener installation underBazelTestRunner).Config: addsDD_TEST_OPTIMIZATION_MANIFEST_FILEandDD_TEST_OPTIMIZATION_PAYLOADS_IN_FILES; skips API-key validation in these modes.TEST_UNDECLARED_OUTPUTS_DIRis read directly inBazelMode(it's a Bazel-provided env var, not a DD config).Motivation
Bazel can run tests in hermetic sandboxes with no network access. The existing CI Visibility pipeline requires HTTP calls to fetch configuration and submit payloads, which is incompatible with Bazel's execution model. Most of our operations, such as tagging tests with git metadata, also invalid Bazel's cache. This PR enables CI Visibility under Bazel by reading configuration from pre-fetched cache files and writing payloads/telemetry to files, with the orchestration of everything else being handled by our custom testing rule.
Additional Notes
BazelModeTest,FileBasedConfigurationApiTest(shares the existing*-response.ftlfixtures withConfigurationApiImplTestto keep the HTTP and file code paths in sync),FileBasedPayloadDispatcherTest,FileBasedTelemetryClientTest, and extendedTelemetryRouterSpecification.DataDog/rules_test_optimization_tests: 3test+ 1test_suite_end+ 1test_module_end+ 1test_session_endevents emitted to the payload file, no duplicate listener errors, no schema-validation failures.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsJira ticket: SDTEST-3335
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.