Skip to content

Commit 4bd2560

Browse files
authored
Merge branch 'main' into main
2 parents 8a19adc + 5c60f12 commit 4bd2560

File tree

179 files changed

+6037
-2301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+6037
-2301
lines changed

.cspell.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"anyvalue",
3030
"appender",
3131
"appenders",
32+
"autobenches",
3233
"Bhasin",
3334
"BLRP",
3435
"Cijo",
@@ -42,6 +43,8 @@
4243
"Dwarnings",
4344
"EPYC",
4445
"flamegraph",
46+
"Gerring",
47+
"Grübel",
4548
"hasher",
4649
"Isobel",
4750
"jaegertracing",

.github/workflows/benchmark.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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.
3+
#
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:
11+
pull_request:
12+
push:
13+
branches:
14+
- main
15+
name: benchmark pull requests
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
runBenchmark:
21+
name: run benchmark
22+
permissions:
23+
pull-requests: write
24+
25+
# If we're running on a PR, use ubuntu-latest - a shared runner. We can't use the self-hosted
26+
# runners on arbitrary PRs, and we don't want to unleash that load on the pool anyway.
27+
# If we're running on main, use the OTEL self-hosted runner pool.
28+
29+
# TODO - temporarily move main to the shared workers, until we've resolved the instance setup issue
30+
# runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'self-hosted' }}
31+
runs-on: 'ubuntu-latest'
32+
if: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'performance')) || github.event_name == 'push' }}
33+
env:
34+
# For PRs, compare against the base branch - e.g., 'main'.
35+
# For pushes to main, compare against the previous commit
36+
BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.base_ref || github.event.before }}
37+
steps:
38+
- name: Harden the runner (Audit all outbound calls)
39+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
40+
with:
41+
egress-policy: audit
42+
43+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
with:
45+
fetch-depth: 10 # Fetch current commit and its parent
46+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
47+
with:
48+
repo-token: ${{ secrets.GITHUB_TOKEN }}
49+
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
50+
with:
51+
toolchain: stable
52+
- uses: boa-dev/criterion-compare-action@adfd3a94634fe2041ce5613eb7df09d247555b87 # v3.2.4
53+
with:
54+
branchName: ${{ env.BRANCH_NAME }}

.github/workflows/ci.yml

Lines changed: 103 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: CI
22
env:
33
CI: true
4+
permissions:
5+
contents: read
46
on:
57
pull_request:
68
push:
@@ -29,43 +31,55 @@ jobs:
2931
runs-on: ${{ matrix.os }}
3032
continue-on-error: ${{ matrix.rust == 'beta' }}
3133
steps:
34+
- name: Harden the runner (Audit all outbound calls)
35+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
36+
with:
37+
egress-policy: audit
38+
3239
- name: Free disk space
3340
if: ${{ matrix.os == 'ubuntu-latest'}}
3441
run: |
3542
df -h
3643
sudo rm -rf /usr/local/lib/android
3744
sudo rm -rf /usr/share/dotnet
3845
df -h
39-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4047
with:
4148
submodules: true
42-
- uses: dtolnay/rust-toolchain@master
49+
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
4350
with:
4451
toolchain: ${{ matrix.rust }}
4552
components: rustfmt
4653
- name: "Set rustup profile"
4754
run: rustup set profile minimal
48-
- uses: arduino/setup-protoc@v3
55+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
4956
with:
5057
repo-token: ${{ secrets.GITHUB_TOKEN }}
5158
- name: Test
5259
run: bash ./scripts/test.sh
5360
lint:
5461
runs-on: ubuntu-latest
5562
steps:
56-
- uses: actions/checkout@v4
63+
- name: Harden the runner (Audit all outbound calls)
64+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
65+
with:
66+
egress-policy: audit
67+
68+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5769
with:
5870
submodules: true
59-
- uses: dtolnay/rust-toolchain@stable
71+
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
6072
with:
61-
components: rustfmt
62-
- uses: arduino/setup-protoc@v3
73+
toolchain: stable
74+
components: rustfmt, clippy
75+
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc # v2.49.45
6376
with:
64-
repo-token: ${{ secrets.GITHUB_TOKEN }}
65-
- uses: actions-rs/cargo@v1
77+
tool: cargo-hack
78+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
6679
with:
67-
command: fmt
68-
args: --all -- --check
80+
repo-token: ${{ secrets.GITHUB_TOKEN }}
81+
- name: Format
82+
run: cargo fmt --all -- --check
6983
- name: Lint
7084
run: bash ./scripts/lint.sh
7185
external-types:
@@ -74,8 +88,13 @@ jobs:
7488
example: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin]
7589
runs-on: ubuntu-latest # TODO: Check if this could be covered for Windows. The step used currently fails on Windows.
7690
steps:
77-
- uses: actions/checkout@v4
78-
- uses: dtolnay/rust-toolchain@nightly
91+
- name: Harden the runner (Audit all outbound calls)
92+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
93+
with:
94+
egress-policy: audit
95+
96+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
97+
- uses: dtolnay/rust-toolchain@a02741459ec5e501b9843ed30b535ca0a0376ae4
7998
with:
8099
toolchain: nightly-2024-06-30
81100
components: rustfmt
@@ -92,11 +111,16 @@ jobs:
92111
runs-on: ${{ matrix.os }}
93112
continue-on-error: true
94113
steps:
95-
- uses: actions/checkout@v4
114+
- name: Harden the runner (Audit all outbound calls)
115+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
116+
with:
117+
egress-policy: audit
118+
119+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
96120
with:
97121
submodules: true
98122
- name: Set up Rust ${{ matrix.rust }}
99-
uses: dtolnay/rust-toolchain@master
123+
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
100124
with:
101125
toolchain: ${{ matrix.rust }}
102126
- name: Patch dependencies versions
@@ -107,19 +131,48 @@ jobs:
107131
runs-on: ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux
108132
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci
109133
steps:
110-
- uses: actions/checkout@v4
111-
- uses: EmbarkStudios/cargo-deny-action@v1
134+
- name: Harden the runner (Audit all outbound calls)
135+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
136+
with:
137+
egress-policy: audit
138+
139+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
140+
141+
- name: Check advisories
142+
uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
112143
with:
113144
command: check advisories
145+
146+
- name: Check licenses
147+
uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
148+
with:
149+
command: check licenses
150+
151+
- name: Check bans
152+
uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
153+
with:
154+
command: check bans
155+
156+
- name: Check sources
157+
uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
158+
with:
159+
command: check sources
160+
114161
docs:
115162
continue-on-error: true
116163
runs-on: ubuntu-latest
117164
steps:
118-
- uses: actions/checkout@v4
119-
- uses: dtolnay/rust-toolchain@stable
165+
- name: Harden the runner (Audit all outbound calls)
166+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
167+
with:
168+
egress-policy: audit
169+
170+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
171+
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
120172
with:
173+
toolchain: stable
121174
components: rustfmt
122-
- uses: arduino/setup-protoc@v3
175+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
123176
with:
124177
repo-token: ${{ secrets.GITHUB_TOKEN }}
125178
- name: doc
@@ -132,26 +185,51 @@ jobs:
132185
runs-on: ubuntu-latest
133186
if: ${{ ! contains(github.event.pull_request.labels.*.name, 'dependencies') }}
134187
steps:
135-
- uses: actions/checkout@v4
188+
- name: Harden the runner (Audit all outbound calls)
189+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
190+
with:
191+
egress-policy: audit
192+
193+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
136194
with:
137195
submodules: true
138-
- uses: dtolnay/rust-toolchain@stable
196+
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
139197
with:
140198
toolchain: stable
141199
components: rustfmt,llvm-tools-preview
142-
- uses: arduino/setup-protoc@v3
200+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
143201
with:
144202
repo-token: ${{ secrets.GITHUB_TOKEN }}
145203
- name: cargo install cargo-llvm-cov
146-
uses: taiki-e/install-action@cargo-llvm-cov
204+
uses: taiki-e/install-action@5075451c95db43b063f20f0c8fef04c04d5bf0ba # cargo-llvm-cov
147205
- name: cargo generate-lockfile
148206
if: hashFiles('Cargo.lock') == ''
149207
run: cargo generate-lockfile
150208
- name: cargo llvm-cov
151209
run: cargo llvm-cov --locked --all-features --workspace --lcov --lib --output-path lcov.info
152210
- name: Upload to codecov.io
153-
uses: codecov/codecov-action@v4
211+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
154212
env:
155213
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
156214
with:
157215
fail_ci_if_error: true
216+
cargo-machete:
217+
continue-on-error: true
218+
runs-on: ubuntu-latest
219+
steps:
220+
- name: Harden the runner (Audit all outbound calls)
221+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
222+
with:
223+
egress-policy: audit
224+
225+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
226+
with:
227+
submodules: true
228+
- uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0
229+
with:
230+
toolchain: stable
231+
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc # v2.49.45
232+
with:
233+
tool: cargo-machete
234+
- name: cargo machete
235+
run: cargo machete
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "CodeQL Analysis"
2+
3+
env:
4+
CODEQL_ENABLE_EXPERIMENTAL_FEATURES : true # CodeQL support for Rust is experimental
5+
6+
permissions:
7+
contents: read
8+
9+
on:
10+
pull_request:
11+
push:
12+
branches: [main]
13+
workflow_dispatch:
14+
15+
jobs:
16+
analyze:
17+
name: Analyze
18+
runs-on: ubuntu-latest
19+
permissions:
20+
security-events: write # for github/codeql-action/autobuild to send a status report
21+
22+
strategy:
23+
fail-fast: false
24+
25+
steps:
26+
- name: Harden the runner (Audit all outbound calls)
27+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
28+
with:
29+
egress-policy: audit
30+
31+
- name: Checkout repository
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
with:
34+
submodules: true
35+
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
38+
with:
39+
languages: rust
40+
41+
- name: Autobuild
42+
uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
43+
44+
- name: Perform CodeQL Analysis
45+
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15

.github/workflows/fossa.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ jobs:
1212
fossa:
1313
runs-on: ubuntu-latest
1414
steps:
15+
- name: Harden the runner (Audit all outbound calls)
16+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
17+
with:
18+
egress-policy: audit
19+
1520
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1621

17-
- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
22+
- uses: fossas/fossa-action@c0a7d013f84c8ee5e910593186598625513cc1e4 # v1.6.0
1823
with:
1924
api-key: ${{secrets.FOSSA_API_KEY}}
2025
team: OpenTelemetry

.github/workflows/integration_tests.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,33 @@ on:
55
pull_request:
66
types: [ labeled, synchronize, opened, reopened ]
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
integration_tests:
1013
runs-on: ubuntu-latest
1114
timeout-minutes: 10
1215
steps:
16+
- name: Harden the runner (Audit all outbound calls)
17+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
18+
with:
19+
egress-policy: audit
20+
1321
- name: Free disk space
1422
run: |
1523
df -h
1624
sudo rm -rf /usr/local/lib/android
1725
sudo rm -rf /usr/share/dotnet
1826
df -h
19-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2028
with:
2129
submodules: true
22-
- uses: dtolnay/rust-toolchain@stable
30+
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4
2331
with:
32+
toolchain: stable
2433
components: rustfmt
25-
- uses: arduino/setup-protoc@v3
34+
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
2635
with:
2736
repo-token: ${{ secrets.GITHUB_TOKEN }}
2837
- name: Run integration tests

0 commit comments

Comments
 (0)