Skip to content

Commit f8eae2c

Browse files
authored
Merge branch 'main' into cijothomas/conversionperf
2 parents 96ef7be + f29a3d2 commit f8eae2c

32 files changed

Lines changed: 1474 additions & 333 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 89 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,53 @@
1-
# This workflow runs a Criterion benchmark on a PR and compares the results against the base branch.
2-
# It is triggered on a PR or a push to main.
1+
# This workflow has two jobs:
2+
# 1. compareBenchmark: Runs on PRs with the "performance" label, comparing Criterion
3+
# benchmark results against the base branch using criterion-compare-action.
4+
# 2. continuousBenchmark: Runs daily on main via schedule, storing benchmark results
5+
# in the gh-pages branch and publishing a dashboard via github-action-benchmark.
6+
# Skips runs where the HEAD commit has already been benchmarked.
37
#
4-
# The workflow is gated on the presence of the "performance" label on the PR.
5-
#
6-
# The workflow runs on a self-hosted runner pool. We can't use the shared runners for this,
7-
# because they are only permitted to run on the default branch to preserve resources.
8-
#
9-
# In the future, we might like to consider using bencher.dev or the framework used by otel-golang here.
10-
on:
8+
# The PR job runs on shared GitHub runners to save resources.
9+
# The continuous job runs on a self-hosted bare-metal runner for consistent, accurate results.
10+
on:
1111
pull_request:
1212
types: [labeled, synchronize]
13-
push:
14-
branches:
15-
- main
16-
name: benchmark pull requests
13+
schedule:
14+
- cron: '0 6 * * *' # daily at 06:00 UTC
15+
workflow_dispatch:
16+
name: benchmark
1717
permissions:
1818
contents: read
1919
jobs:
20-
runBenchmark:
21-
name: run benchmark
20+
# ---------------------------------------------------------------------------
21+
# PR benchmark comparison
22+
# ---------------------------------------------------------------------------
23+
compareBenchmark:
24+
name: compare benchmarks (PR)
25+
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'performance')
26+
runs-on: ubuntu-latest
2227
permissions:
2328
pull-requests: write
24-
25-
# If we're running on main, use our oracle bare-metal runner for accuracy.
26-
# If we're running on a PR, use github's shared workers to save resources.
27-
runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'oracle-bare-metal-64cpu-512gb-x86-64' }}
28-
if: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'performance')) || github.event_name == 'push' }}
2929
container:
3030
image: rust:slim-bullseye
3131
env:
32-
# For PRs, compare against the base branch - e.g., 'main'.
33-
# For pushes to main, compare against the previous commit
34-
BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.base_ref || github.event.before }}
32+
BRANCH_NAME: ${{ github.base_ref }}
3533
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
3634
steps:
3735
- name: Harden the runner (Audit all outbound calls)
38-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
36+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
3937
with:
4038
egress-policy: audit
4139

4240
- name: Setup container environment
4341
run: |
44-
apt-get update && apt-get install --fix-missing -y unzip cmake build-essential pkg-config curl git
42+
apt-get update && apt-get install --fix-missing -y unzip cmake build-essential pkg-config curl git libssl-dev
4543
cargo install cargo-criterion
4644
4745
- name: Make repo safe for Git inside container
4846
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
4947

50-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
48+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5149
with:
52-
fetch-depth: 10 # Fetch a bit of history so we can do perf diffs
50+
fetch-depth: 10
5351

5452
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
5553
with:
@@ -58,3 +56,67 @@ jobs:
5856
- uses: boa-dev/criterion-compare-action@adfd3a94634fe2041ce5613eb7df09d247555b87 # v3.2.4
5957
with:
6058
branchName: ${{ env.BRANCH_NAME }}
59+
60+
# ---------------------------------------------------------------------------
61+
# Continuous benchmark tracking (daily schedule)
62+
# ---------------------------------------------------------------------------
63+
continuousBenchmark:
64+
name: continuous benchmark tracking
65+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
66+
# Use bare-metal runner on the upstream repo for consistent results; fall back to shared runners elsewhere
67+
runs-on: ${{ github.repository == 'open-telemetry/opentelemetry-rust' && 'oracle-bare-metal-64cpu-512gb-x86-64' || 'ubuntu-latest' }}
68+
permissions:
69+
contents: write
70+
container:
71+
image: rust:slim-bullseye
72+
env:
73+
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
74+
steps:
75+
- name: Harden the runner (Audit all outbound calls)
76+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
77+
with:
78+
egress-policy: audit
79+
80+
- name: Setup container environment
81+
run: |
82+
apt-get update && apt-get install --fix-missing -y unzip cmake build-essential pkg-config curl git libssl-dev
83+
84+
- name: Make repo safe for Git inside container
85+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
86+
87+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
88+
89+
- name: Check if commit already benchmarked
90+
id: check_duplicate
91+
run: |
92+
# Fetch the benchmark data file from gh-pages and see if this commit is already recorded
93+
DATA_URL="https://raw.githubusercontent.com/${{ github.repository }}/gh-pages/dev/bench/data.js"
94+
if curl -sf "$DATA_URL" | grep -q "${{ github.sha }}"; then
95+
echo "skip=true" >> "$GITHUB_OUTPUT"
96+
echo "Commit ${{ github.sha }} already benchmarked, skipping."
97+
else
98+
echo "skip=false" >> "$GITHUB_OUTPUT"
99+
fi
100+
101+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
102+
if: steps.check_duplicate.outputs.skip != 'true'
103+
with:
104+
repo-token: ${{ secrets.GITHUB_TOKEN }}
105+
106+
- name: Run benchmarks
107+
if: steps.check_duplicate.outputs.skip != 'true'
108+
run: cargo bench --workspace --all-features -- --output-format bencher | tee output.txt
109+
110+
- name: Store benchmark result
111+
if: steps.check_duplicate.outputs.skip != 'true'
112+
uses: benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073 # v1.21.0
113+
with:
114+
tool: 'cargo'
115+
output-file-path: output.txt
116+
github-token: ${{ secrets.GITHUB_TOKEN }}
117+
auto-push: true
118+
benchmark-data-dir-path: dev/bench
119+
# Alert if a benchmark regresses by more than 20%
120+
alert-threshold: '120%'
121+
comment-on-alert: true
122+
fail-on-alert: false

.github/workflows/ci.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ permissions:
55
contents: read
66
on:
77
pull_request:
8+
merge_group:
89
push:
910
branches:
1011
- main
@@ -32,11 +33,11 @@ jobs:
3233
continue-on-error: ${{ matrix.rust == 'beta' }}
3334
steps:
3435
- name: Harden the runner (Audit all outbound calls)
35-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
36+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
3637
with:
3738
egress-policy: audit
3839

39-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
40+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4041
with:
4142
submodules: true
4243
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
@@ -54,18 +55,18 @@ jobs:
5455
runs-on: ubuntu-latest
5556
steps:
5657
- name: Harden the runner (Audit all outbound calls)
57-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
58+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
5859
with:
5960
egress-policy: audit
6061

61-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
62+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6263
with:
6364
submodules: true
6465
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
6566
with:
6667
toolchain: stable
6768
components: rustfmt, clippy
68-
- uses: taiki-e/install-action@650c5ca14212efbbf3e580844b04bdccf68dac31 # v2.67.18
69+
- uses: taiki-e/install-action@68675c5a5f1a6950c3975d33f3ae0ef155e5bf3d # v2.68.15
6970
with:
7071
tool: cargo-hack
7172
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
@@ -82,18 +83,18 @@ jobs:
8283
runs-on: ubuntu-latest # TODO: Check if this could be covered for Windows. The step used currently fails on Windows.
8384
steps:
8485
- name: Harden the runner (Audit all outbound calls)
85-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
86+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
8687
with:
8788
egress-policy: audit
8889

89-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
90+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9091
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
9192
with:
9293
# Rust version should be kept in sync with the one the release was tested with
9394
# https://github.com/awslabs/cargo-check-external-types/releases
9495
toolchain: nightly-2025-05-04
9596
components: rustfmt
96-
- uses: taiki-e/install-action@650c5ca14212efbbf3e580844b04bdccf68dac31 # v2.67.18
97+
- uses: taiki-e/install-action@68675c5a5f1a6950c3975d33f3ae0ef155e5bf3d # v2.68.15
9798
with:
9899
tool: cargo-check-external-types@0.2.0
99100
- name: external-type-check
@@ -107,17 +108,17 @@ jobs:
107108
continue-on-error: true
108109
steps:
109110
- name: Harden the runner (Audit all outbound calls)
110-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
111+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
111112
with:
112113
egress-policy: audit
113114

114-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
115+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
115116
with:
116117
submodules: true
117118
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
118119
with:
119120
toolchain: stable
120-
- uses: taiki-e/install-action@650c5ca14212efbbf3e580844b04bdccf68dac31 # v2.67.18
121+
- uses: taiki-e/install-action@68675c5a5f1a6950c3975d33f3ae0ef155e5bf3d # v2.68.15
121122
with:
122123
tool: cargo-msrv
123124
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
@@ -130,11 +131,11 @@ jobs:
130131
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci
131132
steps:
132133
- name: Harden the runner (Audit all outbound calls)
133-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
134+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
134135
with:
135136
egress-policy: audit
136137

137-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
138+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
138139

139140
- name: Check advisories
140141
uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2.0.15
@@ -161,11 +162,11 @@ jobs:
161162
runs-on: ubuntu-latest
162163
steps:
163164
- name: Harden the runner (Audit all outbound calls)
164-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
165+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
165166
with:
166167
egress-policy: audit
167168

168-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
169+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
169170
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
170171
with:
171172
toolchain: stable
@@ -184,11 +185,11 @@ jobs:
184185
if: ${{ ! contains(github.event.pull_request.labels.*.name, 'dependencies') }}
185186
steps:
186187
- name: Harden the runner (Audit all outbound calls)
187-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
188+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
188189
with:
189190
egress-policy: audit
190191

191-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
192+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
192193
with:
193194
submodules: true
194195
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
@@ -199,7 +200,7 @@ jobs:
199200
with:
200201
repo-token: ${{ secrets.GITHUB_TOKEN }}
201202
- name: Install cargo-llvm-cov
202-
uses: taiki-e/install-action@650c5ca14212efbbf3e580844b04bdccf68dac31 # v2.67.18
203+
uses: taiki-e/install-action@68675c5a5f1a6950c3975d33f3ae0ef155e5bf3d # v2.68.15
203204
with:
204205
tool: cargo-llvm-cov
205206
- name: cargo generate-lockfile
@@ -216,7 +217,7 @@ jobs:
216217
build-examples:
217218
runs-on: ubuntu-latest
218219
steps:
219-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
220+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
220221
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # stable
221222
with:
222223
toolchain: stable
@@ -237,11 +238,11 @@ jobs:
237238
runs-on: ubuntu-latest
238239
steps:
239240
- name: Harden the runner (Audit all outbound calls)
240-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
241+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
241242
with:
242243
egress-policy: audit
243244

244-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
245+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
245246
with:
246247
submodules: true
247248
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9
@@ -250,7 +251,7 @@ jobs:
250251
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
251252
with:
252253
repo-token: ${{ secrets.GITHUB_TOKEN }}
253-
- uses: taiki-e/install-action@650c5ca14212efbbf3e580844b04bdccf68dac31 # v2.67.18
254+
- uses: taiki-e/install-action@68675c5a5f1a6950c3975d33f3ae0ef155e5bf3d # v2.68.15
254255
with:
255256
tool: cargo-shear
256257
- name: cargo shear

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ permissions:
88

99
on:
1010
pull_request:
11+
merge_group:
1112
push:
1213
branches: [main]
1314
workflow_dispatch:
@@ -24,12 +25,12 @@ jobs:
2425

2526
steps:
2627
- name: Harden the runner (Audit all outbound calls)
27-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
28+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
2829
with:
2930
egress-policy: audit
3031

3132
- name: Checkout repository
32-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3334
with:
3435
submodules: true
3536

.github/workflows/fossa.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Harden the runner (Audit all outbound calls)
16-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
16+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
1717
with:
1818
egress-policy: audit
1919

20-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2121

22-
- uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
22+
- uses: fossas/fossa-action@c414b9ad82eaad041e47a7cf62a4f02411f427a0 # v1.8.0
2323
with:
2424
api-key: ${{secrets.FOSSA_API_KEY}}
2525
team: OpenTelemetry

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
timeout-minutes: 10
1515
steps:
1616
- name: Harden the runner (Audit all outbound calls)
17-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
17+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
1818
with:
1919
egress-policy: audit
2020

21-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2222
with:
2323
submodules: true
2424
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9

.github/workflows/markdown-link-check.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Markdown link check
22

33
on:
44
pull_request:
5+
merge_group:
56
push:
67
branches:
78
- main
@@ -16,11 +17,11 @@ jobs:
1617
runs-on: ubuntu-latest
1718
steps:
1819
- name: Harden the runner (Audit all outbound calls)
19-
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
20+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
2021
with:
2122
egress-policy: audit
2223

23-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
24+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2425

2526
- name: Install markdown-link-check
2627
run: npm install -g "git://github.com/tcort/markdown-link-check.git#ef7e09486e579ba7479700b386e7ca90f34cbd0a" # v3.13.7

0 commit comments

Comments
 (0)