Skip to content

Pin apm-sdks-benchmarks and add tooling to automatically update pin - #12153

Open
sarahchen6 wants to merge 3 commits into
masterfrom
sarahchen6/pin-benchmarks
Open

Pin apm-sdks-benchmarks and add tooling to automatically update pin#12153
sarahchen6 wants to merge 3 commits into
masterfrom
sarahchen6/pin-benchmarks

Conversation

@sarahchen6

@sarahchen6 sarahchen6 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Pin our apm-sdks-benchmarks reference to the current latest commit SHA on main. Add tooling to update this pinned SHA.

Motivation

Currently, any change made to apm-sdks-benchmarks will take immediate effect in this repo. We should pin this reference to protect CI and releases.

Additional Notes

The tooling automation will run once a week at the same frequency in which we update our gradle dependencies. It can also be manually triggered. The PR also goes in tandem with https://github.com/DataDog/apm-sdks-benchmarks/pull/228 (merged) which allows reading apm-sdks-benchmarks repo and https://github.com/DataDog/apm-sdks-benchmarks/pull/230 (waiting on review) which applies the logic to clone the repo at the specified SHA to the post-pr-comment job.

Testing

The tooling/update_apm_sdks_benchmarks_reference.sh script works locally, and the .github/workflows/update-apm-sdks-benchmarks-reference.yaml is based on existing working GitHub workflows. However, the workflow cannot be tested end-to-end until it lands on master because the dd-octo-sts permissions are scoped to and passed from master.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@sarahchen6 sarahchen6 added type: feature Enhancements and improvements tag: no release notes Changes to exclude from release notes comp: tooling Build & Tooling labels Aug 5, 2026
@dd-octo-sts

dd-octo-sts Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)

Suite Status
Startup 🟡 warning

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 14.70 s 14.75 s [-1.3%; +0.6%] (no difference)
startup:insecure-bank:tracing:Agent 13.51 s 13.64 s [-1.6%; -0.4%] (maybe better)
startup:petclinic:appsec:Agent 16.84 s 17.31 s [-7.0%; +1.6%] (no difference)
startup:petclinic:iast:Agent 17.37 s 16.98 s [-1.9%; +6.5%] (no difference)
startup:petclinic:profiling:Agent 17.34 s 17.49 s [-2.0%; +0.3%] (no difference)
startup:petclinic:sca:Agent 17.36 s 17.25 s [-0.3%; +1.6%] (no difference)
startup:petclinic:tracing:Agent 16.16 s 16.65 s [-7.0%; +1.2%] (no difference)

Commit: 761a7523 · 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.

@datadog-official

This comment has been minimized.

@sarahchen6
sarahchen6 marked this pull request as ready for review August 6, 2026 20:44
@sarahchen6
sarahchen6 requested review from a team as code owners August 6, 2026 20:44
@sarahchen6
sarahchen6 requested review from AlexeyKuznetsov-DD, PerfectSlayer and erikayasuda and removed request for a team August 6, 2026 20:44

@datadog-official datadog-official Bot left a comment

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.

Datadog Autotest: PASS

More details

The new updater correctly replaces all five pinned GitLab includes and the runtime clone SHA, rejects malformed commit inputs, and is idempotent when rerun. Workflow syntax parsed successfully and its token, checkout, commit-headless, and PR steps match existing repository automation; no concrete behavioral regression was identified.

Was this helpful? React 👍 or 👎

📊 Validated against 7 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 761a752 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@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: 761a752366

ℹ️ 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/update-apm-sdks-benchmarks-reference.yaml

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD left a comment

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.

LGTM, but I proposed optional improvement to use references like *apm_sdks_benchmarks_sha that will reduce future PRs to one line.

Comment thread .gitlab-ci.yml
Comment on lines +6 to 22
# Refs pinned by the "Update apm-sdks-benchmarks reference" workflow
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-spring-petclinic-parallel.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-load-parallel.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-startup-parallel.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-dacapo-parallel.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-post-pr-comment.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- local: ".gitlab/java-benchmark-configs.yml"

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.

To reduce future PRs, this can be used:

Suggested change
# Refs pinned by the "Update apm-sdks-benchmarks reference" workflow
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-spring-petclinic-parallel.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-load-parallel.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-startup-parallel.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-dacapo-parallel.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-post-pr-comment.yml'
ref: 'main'
ref: 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- local: ".gitlab/java-benchmark-configs.yml"
# Refs pinned by the "Update apm-sdks-benchmarks reference" workflow
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-spring-petclinic-parallel.yml'
ref: &apm_sdks_benchmarks_sha 'f59ec6a23d07cb63650a2c8c694a45e479ab0dc2'
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-load-parallel.yml'
ref: *apm_sdks_benchmarks_sha
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-startup-parallel.yml'
ref: *apm_sdks_benchmarks_sha
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-dacapo-parallel.yml'
ref: *apm_sdks_benchmarks_sha
- project: 'DataDog/apm-reliability/apm-sdks-benchmarks'
file: '.gitlab/ci-java-post-pr-comment.yml'
ref: *apm_sdks_benchmarks_sha
- local: ".gitlab/java-benchmark-configs.yml"

Comment thread .gitlab-ci.yml
- generate-signing-key

variables:
APM_SDKS_BENCHMARKS_SHA: "f59ec6a23d07cb63650a2c8c694a45e479ab0dc2" # pinned by "Update apm-sdks-benchmarks reference" workflow

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.

Suggested change
APM_SDKS_BENCHMARKS_SHA: "f59ec6a23d07cb63650a2c8c694a45e479ab0dc2" # pinned by "Update apm-sdks-benchmarks reference" workflow
APM_SDKS_BENCHMARKS_SHA: *apm_sdks_benchmarks_sha

Comment on lines +1 to +50
#!/usr/bin/env bash
set -euo pipefail

# This script updates the apm-sdks-benchmarks include references and runtime
# clone SHA used by GitLab CI.
# Usage: tooling/update_apm_sdks_benchmarks_reference.sh <commit-sha>

if [[ $# -ne 1 || ! "$1" =~ ^[0-9a-f]{40}$ ]]; then
echo "Usage: $0 <40-character commit SHA>" >&2
exit 1
fi

REF="$1"
GITLAB_TARGET=".gitlab-ci.yml"
PROJECT="DataDog/apm-reliability/apm-sdks-benchmarks"
REFERENCE_PATTERN="( - project: '$PROJECT'\n file: '[^']+'\n ref: ')(?:main|[0-9a-f]{40})(')"
SHA_PATTERN='( APM_SDKS_BENCHMARKS_SHA: ")[0-9a-f]{40}(")'

if [[ ! -f "$GITLAB_TARGET" ]]; then
echo "Error: Target file $GITLAB_TARGET does not exist" >&2
exit 1
fi

REFERENCE_COUNT=$(REFERENCE_PATTERN="$REFERENCE_PATTERN" perl -0ne '
$count++ while /$ENV{REFERENCE_PATTERN}/g;
END { print $count // 0 }
' "$GITLAB_TARGET")
SHA_COUNT=$(SHA_PATTERN="$SHA_PATTERN" perl -0ne '
$count++ while /$ENV{SHA_PATTERN}/g;
END { print $count // 0 }
' "$GITLAB_TARGET")

if [[ "$REFERENCE_COUNT" -eq 0 ]]; then
echo "Error: No $PROJECT references found" >&2
exit 1
fi
if [[ "$SHA_COUNT" -eq 0 ]]; then
echo "Error: No APM_SDKS_BENCHMARKS_SHA variables found" >&2
exit 1
fi

REFERENCE_PATTERN="$REFERENCE_PATTERN" REF="$REF" perl -0pi -e '
s/$ENV{REFERENCE_PATTERN}/${1}$ENV{REF}${2}/g
' "$GITLAB_TARGET"
SHA_PATTERN="$SHA_PATTERN" REF="$REF" perl -0pi -e '
s/$ENV{SHA_PATTERN}/${1}$ENV{REF}${2}/g
' "$GITLAB_TARGET"

echo "Updated $REFERENCE_COUNT apm-sdks-benchmarks references and" \
"$SHA_COUNT runtime clone SHA variables to $REF"

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.

Suggested change
#!/usr/bin/env bash
set -euo pipefail
# This script updates the apm-sdks-benchmarks include references and runtime
# clone SHA used by GitLab CI.
# Usage: tooling/update_apm_sdks_benchmarks_reference.sh <commit-sha>
if [[ $# -ne 1 || ! "$1" =~ ^[0-9a-f]{40}$ ]]; then
echo "Usage: $0 <40-character commit SHA>" >&2
exit 1
fi
REF="$1"
GITLAB_TARGET=".gitlab-ci.yml"
PROJECT="DataDog/apm-reliability/apm-sdks-benchmarks"
REFERENCE_PATTERN="( - project: '$PROJECT'\n file: '[^']+'\n ref: ')(?:main|[0-9a-f]{40})(')"
SHA_PATTERN='( APM_SDKS_BENCHMARKS_SHA: ")[0-9a-f]{40}(")'
if [[ ! -f "$GITLAB_TARGET" ]]; then
echo "Error: Target file $GITLAB_TARGET does not exist" >&2
exit 1
fi
REFERENCE_COUNT=$(REFERENCE_PATTERN="$REFERENCE_PATTERN" perl -0ne '
$count++ while /$ENV{REFERENCE_PATTERN}/g;
END { print $count // 0 }
' "$GITLAB_TARGET")
SHA_COUNT=$(SHA_PATTERN="$SHA_PATTERN" perl -0ne '
$count++ while /$ENV{SHA_PATTERN}/g;
END { print $count // 0 }
' "$GITLAB_TARGET")
if [[ "$REFERENCE_COUNT" -eq 0 ]]; then
echo "Error: No $PROJECT references found" >&2
exit 1
fi
if [[ "$SHA_COUNT" -eq 0 ]]; then
echo "Error: No APM_SDKS_BENCHMARKS_SHA variables found" >&2
exit 1
fi
REFERENCE_PATTERN="$REFERENCE_PATTERN" REF="$REF" perl -0pi -e '
s/$ENV{REFERENCE_PATTERN}/${1}$ENV{REF}${2}/g
' "$GITLAB_TARGET"
SHA_PATTERN="$SHA_PATTERN" REF="$REF" perl -0pi -e '
s/$ENV{SHA_PATTERN}/${1}$ENV{REF}${2}/g
' "$GITLAB_TARGET"
echo "Updated $REFERENCE_COUNT apm-sdks-benchmarks references and" \
"$SHA_COUNT runtime clone SHA variables to $REF"
#!/usr/bin/env bash
set -euo pipefail
# This script updates the shared SHA used by the apm-sdks-benchmarks includes
# and runtime clone in GitLab CI.
# Usage: tooling/update_apm_sdks_benchmarks_reference.sh <commit-sha>
if [[ $# -ne 1 || ! "$1" =~ ^[0-9a-f]{40}$ ]]; then
echo "Usage: $0 <40-character commit SHA>" >&2
exit 1
fi
REF="$1"
GITLAB_TARGET=".gitlab-ci.yml"
PROJECT="DataDog/apm-reliability/apm-sdks-benchmarks"
REFERENCE_PATTERN="( - project: '$PROJECT'\n file: '[^']+'\n ref: &apm_sdks_benchmarks_sha ')(?:main|[0-9a-f]{40})(')"
SHA_PATTERN=' APM_SDKS_BENCHMARKS_SHA: \*apm_sdks_benchmarks_sha'
if [[ ! -f "$GITLAB_TARGET" ]]; then
echo "Error: Target file $GITLAB_TARGET does not exist" >&2
exit 1
fi
REFERENCE_COUNT=$(REFERENCE_PATTERN="$REFERENCE_PATTERN" perl -0ne '
$count++ while /$ENV{REFERENCE_PATTERN}/g;
END { print $count // 0 }
' "$GITLAB_TARGET")
SHA_COUNT=$(SHA_PATTERN="$SHA_PATTERN" perl -0ne '
$count++ while /$ENV{SHA_PATTERN}/g;
END { print $count // 0 }
' "$GITLAB_TARGET")
if [[ "$REFERENCE_COUNT" -ne 1 ]]; then
echo "Error: Expected one anchored $PROJECT reference, found $REFERENCE_COUNT" >&2
exit 1
fi
if [[ "$SHA_COUNT" -ne 1 ]]; then
echo "Error: Expected APM_SDKS_BENCHMARKS_SHA to use the shared anchor" >&2
exit 1
fi
REFERENCE_PATTERN="$REFERENCE_PATTERN" REF="$REF" perl -0pi -e '
s/$ENV{REFERENCE_PATTERN}/${1}$ENV{REF}${2}/g
' "$GITLAB_TARGET"
echo "Updated the shared apm-sdks-benchmarks SHA to $REF"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: no release notes Changes to exclude from release notes type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants