Skip to content

feat(ci): pilot native Datadog test instrumentation#4911

Open
darccio wants to merge 9 commits into
mainfrom
dd/ci/tighten-dd-test-upload-paths
Open

feat(ci): pilot native Datadog test instrumentation#4911
darccio wants to merge 9 commits into
mainfrom
dd/ci/tighten-dd-test-upload-paths

Conversation

@darccio

@darccio darccio commented Jun 19, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Tightens Datadog CI test uploads and adds a native Test Optimization pilot in one workflow lane.

Summary

Improve reliability and signal quality of Datadog CI test data by narrowing JUnit upload scope, fixing inconsistent tags, and introducing a low-risk native instrumentation pilot while keeping the existing JUnit upload path as fallback.

Changes

  • Updated .github/workflows/multios-unit-tests.yml to:
    • write JUnit output into a dedicated /tmp/test-results directory
    • create the test-results directory before running tests
    • upload only ${{ env.TEST_RESULT_PATH }} to Datadog instead of scanning ./
    • add a pilot Datadog native instrumentation step (datadog/test-visibility-github-action@v2) right before the test step for ubuntu-latest runs when API key credentials are available
    • set JOB_ID: ${{ job.check_run_id }} on the test step for native instrumentation correlation
  • Updated .github/workflows/appsec.yml (AppSec disabled job) to send go:stable instead of an empty go: tag when uploading JUnit results.
  • Kept existing datadog-ci junit upload-based reporting in place during the pilot to avoid regressions and allow comparison.

Motivation

Current uploads included weak points:

  • multios-unit-tests used path: ./, which is broader than necessary and can pick up unrelated files.
  • One AppSec workflow branch emitted an empty go: tag, reducing Datadog filtering/grouping quality.
  • CI data was JUnit-upload only for this workflow, which can still show the “Unlock Advanced Features with Native Instrumentation” banner.

This change keeps uploads focused, normalizes tags, and starts a controlled native instrumentation rollout for one lane.

Testing

  • Ran make lint/action successfully after each workflow edit set.
  • Verified workflow diffs remain scoped to Datadog test upload and pilot instrumentation behavior in:
    • .github/workflows/multios-unit-tests.yml
    • .github/workflows/appsec.yml

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running make lint locally.
  • New code doesn't break existing tests. You can check this by running make test locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • All generated files are up to date. You can check this by running make generate locally.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally.

Unsure? Have a question? Request a review!


PR by Bits - View session in Datadog

Comment @DataDog to request changes

Co-authored-by: darccio <d@rio.hn>
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Jun 19, 2026

Copy link
Copy Markdown

View session in Datadog

Bits Code status: ✅ Done

CI Auto-fix: Disabled | Enable

Comment @DataDog to request changes

@datadog-prod-us1-4

Copy link
Copy Markdown

I can only run on private repositories.

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Jun 19, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 3 Pipeline jobs failed

Pull Request Tests | multios-unit-tests (ubuntu-latest, 1.25) / test-multi-os-instrumented   View in Datadog   GitHub Actions

Pull Request Tests | multios-unit-tests (ubuntu-latest, 1.26) / test-multi-os-instrumented   View in Datadog   GitHub Actions

Check Pull Request CI Status | all-jobs-are-green   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 62.76% (+10.56%)

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Jun 19, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-29 16:09:08

Comparing candidate commit 084643d in PR branch dd/ci/tighten-dd-test-upload-paths with baseline commit 20e44bc in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 321 metrics, 2 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:BenchmarkOTLPTraceWriterFlush

Co-authored-by: darccio <d@rio.hn>
@darccio darccio changed the title feat(ci): tighten Datadog CI test upload paths Pilot native Datadog test instrumentation Jun 19, 2026
@darccio darccio changed the title Pilot native Datadog test instrumentation feat(ci): pilot native Datadog test instrumentation Jun 19, 2026
@darccio darccio marked this pull request as ready for review June 19, 2026 16:21
@darccio darccio requested review from a team as code owners June 19, 2026 16:21

@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: b0cb6f3397

ℹ️ 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".

Comment thread .github/workflows/multios-unit-tests.yml Outdated
Comment thread .github/workflows/multios-unit-tests.yml Outdated
@kakkoyun kakkoyun enabled auto-merge (squash) June 23, 2026 09:55
darccio added 4 commits June 29, 2026 12:57
Add continue-on-error: true so a failure in the datadog/test-visibility-github-action
(network, telemetry, or module download) does not abort the ubuntu-latest lane before
tests run or the JUnit upload fallback executes.
Replaces the mutable @v2 branch reference with the reviewed SHA for
v2.10.0, consistent with how other external actions are pinned in this
repo per .github/dependabot.yml policy.
dd-trace-go is the library that reads DD_CIVISIBILITY_*/DD_ENV at
runtime, so running tests with those env vars set (as the
test-visibility-github-action exports them into GITHUB_ENV) corrupts
the suite: mocktracer type-assert panics, a 15m agentless-writer
timeout, and DD_ENV=ci polluting config-precedence tests.

Split the pilot into a separate job (test-multi-os-instrumented) with
job-level continue-on-error:true so it is non-gating. The gating
test-multi-os job is restored to a clean, un-instrumented state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants