Skip to content

Commit b461111

Browse files
committed
Merge branch 'dev-branch' into 2726-clonebreaking
2 parents b7efe12 + 24b92cb commit b461111

File tree

106 files changed

+2023
-968
lines changed

Some content is hidden

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

106 files changed

+2023
-968
lines changed

.cspell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
"Dwarnings",
4343
"EPYC",
4444
"flamegraph",
45+
"Gerring",
46+
"Grübel",
4547
"hasher",
4648
"Isobel",
4749
"jaegertracing",

.github/workflows/benchmark.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ jobs:
2222
# If we're running on a PR, use ubuntu-latest - a shared runner. We can't use the self-hosted
2323
# runners on arbitrary PRs, and we don't want to unleash that load on the pool anyway.
2424
# If we're running on main, use the OTEL self-hosted runner pool.
25-
runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'self-hosted' }}
25+
26+
# TODO - temporarily move main to the shared workers, until we've resolved the instance setup issue
27+
# runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'self-hosted' }}
28+
runs-on: 'ubuntu-latest'
2629
if: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'performance')) || github.event_name == 'push' }}
2730
env:
2831
# For PRs, compare against the base branch - e.g., 'main'.
@@ -40,15 +43,4 @@ jobs:
4043
toolchain: stable
4144
- uses: boa-dev/criterion-compare-action@v3
4245
with:
43-
cwd: opentelemetry
44-
branchName: ${{ env.BRANCH_NAME }}
45-
- uses: boa-dev/criterion-compare-action@v3
46-
with:
47-
cwd: opentelemetry-appender-tracing
48-
features: spec_unstable_logs_enabled
49-
branchName: ${{ env.BRANCH_NAME }}
50-
- uses: boa-dev/criterion-compare-action@v3
51-
with:
52-
cwd: opentelemetry-sdk
53-
features: rt-tokio,testing,metrics,logs,spec_unstable_metrics_views
5446
branchName: ${{ env.BRANCH_NAME }}

.github/workflows/ci.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ jobs:
5858
submodules: true
5959
- uses: dtolnay/rust-toolchain@stable
6060
with:
61-
components: rustfmt
61+
components: rustfmt, clippy
62+
- uses: taiki-e/install-action@v2
63+
with:
64+
tool: cargo-hack
6265
- uses: arduino/setup-protoc@v3
6366
with:
6467
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -106,7 +109,7 @@ jobs:
106109
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci
107110
steps:
108111
- uses: actions/checkout@v4
109-
- uses: EmbarkStudios/cargo-deny-action@v1
112+
- uses: EmbarkStudios/cargo-deny-action@v2
110113
with:
111114
command: check advisories
112115
docs:
@@ -153,3 +156,18 @@ jobs:
153156
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
154157
with:
155158
fail_ci_if_error: true
159+
cargo-machete:
160+
continue-on-error: true
161+
runs-on: ubuntu-latest
162+
steps:
163+
- uses: actions/checkout@v4
164+
with:
165+
submodules: true
166+
- uses: dtolnay/rust-toolchain@master
167+
with:
168+
toolchain: stable
169+
- uses: taiki-e/install-action@v2
170+
with:
171+
tool: cargo-machete
172+
- name: cargo machete
173+
run: cargo machete

.github/workflows/fossa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1616

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

.github/workflows/ossf-scorecard.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: OSSF Scorecard
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: "50 3 * * 0" # once a week
9+
workflow_dispatch:
10+
11+
permissions: read-all
12+
13+
jobs:
14+
analysis:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
# Needed for Code scanning upload
18+
security-events: write
19+
# Needed for GitHub OIDC token if publish_results is true
20+
id-token: write
21+
steps:
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
25+
26+
- uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
27+
with:
28+
results_file: results.sarif
29+
results_format: sarif
30+
publish_results: true
31+
32+
# Upload the results as artifacts (optional). Commenting out will disable
33+
# uploads of run results in SARIF format to the repository Actions tab.
34+
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
35+
- name: "Upload artifact"
36+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
37+
with:
38+
name: SARIF file
39+
path: results.sarif
40+
retention-days: 5
41+
42+
# Upload the results to GitHub's code scanning dashboard (optional).
43+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
44+
- name: "Upload to code-scanning"
45+
uses: github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
46+
with:
47+
sarif_file: results.sarif

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "opentelemetry-proto/src/proto/opentelemetry-proto"]
22
path = opentelemetry-proto/src/proto/opentelemetry-proto
33
url = https://github.com/open-telemetry/opentelemetry-proto
4-
branch = tags/v1.0.0
4+
branch = tags/v1.5.0

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ exclude = ["opentelemetry-prometheus"]
1919
debug = 1
2020

2121
[workspace.dependencies]
22-
async-std = "1.13"
2322
async-trait = "0.1"
2423
bytes = "1"
2524
criterion = "0.5"
@@ -42,8 +41,8 @@ serde = { version = "1.0", default-features = false }
4241
serde_json = "1.0"
4342
temp-env = "0.3.6"
4443
thiserror = { version = "2", default-features = false }
45-
tonic = { version = "0.12.3", default-features = false }
46-
tonic-build = "0.12"
44+
tonic = { version = "0.13", default-features = false }
45+
tonic-build = "0.13"
4746
tokio = { version = "1", default-features = false }
4847
tokio-stream = "0.1"
4948
# Using `tracing 0.1.40` because 0.1.39 (which is yanked) introduces the ability to set event names in macros,
@@ -75,7 +74,7 @@ sysinfo = "0.32"
7574
tempfile = "3.3.0"
7675
testcontainers = "0.23.1"
7776
tracing-log = "0.2"
78-
tracing-opentelemetry = "0.29"
77+
tracing-opentelemetry = "0.30"
7978
typed-builder = "0.20"
8079
uuid = "1.3"
8180

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,17 @@ you're more than welcome to participate!
179179

180180
### Maintainers
181181

182-
* [Cijo Thomas](https://github.com/cijothomas)
182+
* [Cijo Thomas](https://github.com/cijothomas), Microsoft
183183
* [Harold Dost](https://github.com/hdost)
184-
* [Lalit Kumar Bhasin](https://github.com/lalitb)
185-
* [Utkarsh Umesan Pillai](https://github.com/utpilla)
184+
* [Lalit Kumar Bhasin](https://github.com/lalitb), Microsoft
185+
* [Utkarsh Umesan Pillai](https://github.com/utpilla), Microsoft
186186
* [Zhongyang Wu](https://github.com/TommyCpp)
187187

188188
### Approvers
189189

190-
* [Shaun Cox](https://github.com/shaun-cox)
191-
* [Scott Gerring](https://github.com/scottgerring)
190+
* [Anton Grübel](https://github.com/gruebel), Baz
191+
* [Shaun Cox](https://github.com/shaun-cox), Microsoft
192+
* [Scott Gerring](https://github.com/scottgerring), Datadog
192193

193194
### Emeritus
194195

deny.toml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
exclude=[
2-
"actix-http",
3-
"actix-http-tracing",
4-
"actix-udp",
5-
"actix-udp-example",
6-
"tracing-grpc",
7-
"http"
8-
]
1+
[graph]
2+
exclude=[]
93

104
[licenses]
11-
unlicensed = "deny"
125
allow = [
136
"MIT",
147
"Apache-2.0",
@@ -29,5 +22,5 @@ license-files = [
2922
]
3023

3124
[advisories]
32-
unmaintained = "allow"
25+
unmaintained = "none"
3326
yanked = "allow"

docs/adr/001_error_handling.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,5 @@ Note that at the time of writing, there is no instance we have identified within
171171
We will use [thiserror](https://docs.rs/thiserror/latest/thiserror/) by default to implement Rust's [error trait](https://doc.rust-lang.org/core/error/trait.Error.html).
172172
This keeps our code clean, and as it does not appear in our interface, we can choose to replace any particular usage with a hand-rolled implementation should we need to.
173173

174+
### 6. Don't use `#[non_exhaustive]` by default
175+
If an `Error` response set is closed - if we can confidently say it is very unlikely to gain new variants in the future - we should not annotate it with `#[non_exhaustive]`. By way of example, the variants of the exporter error types described above are exhaustively documented in the OpenTelemetry Specification, and we can confidently say that we do not expect new variants.

docs/design/logs.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,25 @@ only meant for OTel components itself and anyone writing extensions like custom
345345
Exporters etc.
346346

347347
// TODO: Document the principles followed when selecting severity for internal
348-
logs // TODO: Document how this can cause circular loop and plans to address it.
348+
logs
349+
350+
When OpenTelemetry components generate logs that could potentially feed back
351+
into OpenTelemetry, this can result in what is known as "telemetry-induced
352+
telemetry." To address this, OpenTelemetry provides a mechanism to suppress such
353+
telemetry using the `Context`. Components are expected to mark telemetry as
354+
suppressed within a specific `Context` by invoking
355+
`Context::enter_telemetry_suppressed_scope()`. The Logs SDK implementation
356+
checks this flag in the current `Context` and ignores logs if suppression is
357+
enabled.
358+
359+
This mechanism relies on proper in-process propagation of the `Context`.
360+
However, external libraries like `hyper` and `tonic`, which are used by
361+
OpenTelemetry in its OTLP Exporters, do not propagate OpenTelemetry's `Context`.
362+
As a result, the suppression mechanism does not work out-of-the-box to suppress
363+
logs originating from these libraries.
364+
365+
// TODO: Document how OTLP can solve this issue without asking external
366+
crates to respect and propagate OTel Context.
349367

350368
## Summary
351369

examples/logs-basic/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
8+
9+
[[bin]]
10+
name = "logs-basic"
11+
path = "src/main.rs"
12+
bench = false
713

814
[dependencies]
915
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["logs"] }

examples/logs-basic/src/main.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ fn main() {
1515
.with_simple_exporter(exporter)
1616
.build();
1717

18-
// For the OpenTelemetry layer, add a tracing filter to filter events from
19-
// OpenTelemetry and its dependent crates (opentelemetry-otlp uses crates
20-
// like reqwest/tonic etc.) from being sent back to OTel itself, thus
21-
// preventing infinite telemetry generation. The filter levels are set as
22-
// follows:
18+
// To prevent a telemetry-induced-telemetry loop, OpenTelemetry's own internal
19+
// logging is properly suppressed. However, logs emitted by external components
20+
// (such as reqwest, tonic, etc.) are not suppressed as they do not propagate
21+
// OpenTelemetry context. Until this issue is addressed
22+
// (https://github.com/open-telemetry/opentelemetry-rust/issues/2877),
23+
// filtering like this is the best way to suppress such logs.
24+
//
25+
// The filter levels are set as follows:
2326
// - Allow `info` level and above by default.
24-
// - Restrict `opentelemetry`, `hyper`, `tonic`, and `reqwest` completely.
25-
// Note: This will also drop events from crates like `tonic` etc. even when
26-
// they are used outside the OTLP Exporter. For more details, see:
27-
// https://github.com/open-telemetry/opentelemetry-rust/issues/761
27+
// - Completely restrict logs from `hyper`, `tonic`, `h2`, and `reqwest`.
28+
//
29+
// Note: This filtering will also drop logs from these components even when
30+
// they are used outside of the OTLP Exporter.
2831
let filter_otel = EnvFilter::new("info")
2932
.add_directive("hyper=off".parse().unwrap())
30-
.add_directive("opentelemetry=off".parse().unwrap())
3133
.add_directive("tonic=off".parse().unwrap())
3234
.add_directive("h2=off".parse().unwrap())
3335
.add_directive("reqwest=off".parse().unwrap());

examples/metrics-advanced/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
8+
9+
[[bin]]
10+
name = "metrics-advanced"
11+
path = "src/main.rs"
12+
bench = false
713

814
[dependencies]
915
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }

examples/metrics-basic/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
8+
9+
[[bin]]
10+
name = "metrics-basic"
11+
path = "src/main.rs"
12+
bench = false
713

814
[dependencies]
915
opentelemetry = { path = "../../opentelemetry", features = ["metrics"] }

examples/tracing-grpc/Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,30 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
78

89
[[bin]] # Bin to run the gRPC server
910
name = "grpc-server"
1011
path = "src/server.rs"
12+
bench = false
1113

1214
[[bin]] # Bin to run the gRPC client
1315
name = "grpc-client"
1416
path = "src/client.rs"
17+
bench = false
1518

1619
[dependencies]
1720
opentelemetry = { path = "../../opentelemetry" }
1821
opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["rt-tokio"] }
1922
opentelemetry-stdout = { workspace = true, features = ["trace"] }
2023
prost = { workspace = true }
2124
tokio = { workspace = true, features = ["full"] }
22-
tonic = { workspace = true, features = ["server", "codegen", "channel", "prost"] }
25+
tonic = { workspace = true, features = ["server", "codegen", "channel", "prost", "router"] }
2326

2427
[build-dependencies]
2528
tonic-build = { workspace = true }
29+
30+
[package.metadata.cargo-machete]
31+
ignored = [
32+
"prost" # needed for `tonic-build`
33+
]

examples/tracing-http-propagator/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ version = "0.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
publish = false
7+
autobenches = false
78

89
[[bin]] # Bin to run the http server
910
name = "http-server"
1011
path = "src/server.rs"
1112
doc = false
13+
bench = false
1214

1315
[[bin]] # Bin to run the client
1416
name = "http-client"
1517
path = "src/client.rs"
1618
doc = false
19+
bench = false
1720

1821
[dependencies]
1922
http-body-util = { workspace = true }
@@ -23,5 +26,8 @@ tokio = { workspace = true, features = ["full"] }
2326
opentelemetry = { path = "../../opentelemetry" }
2427
opentelemetry_sdk = { path = "../../opentelemetry-sdk" }
2528
opentelemetry-http = { path = "../../opentelemetry-http" }
26-
opentelemetry-stdout = { workspace = true, features = ["trace"] }
29+
opentelemetry-stdout = { workspace = true, features = ["trace", "logs"] }
2730
opentelemetry-semantic-conventions = { path = "../../opentelemetry-semantic-conventions" }
31+
opentelemetry-appender-tracing = { workspace = true }
32+
tracing = { workspace = true, features = ["std"]}
33+
tracing-subscriber = { workspace = true, features = ["env-filter","registry", "std", "fmt"] }

0 commit comments

Comments
 (0)