Skip to content

Commit 74c689a

Browse files
authored
Merge branch 'main' into cijothomas/approver-new
2 parents e63bc27 + 62e43c5 commit 74c689a

File tree

75 files changed

+583
-191
lines changed

Some content is hidden

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

75 files changed

+583
-191
lines changed

.github/workflows/benchmark.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
- uses: actions/checkout@v4
3333
with:
3434
fetch-depth: 10 # Fetch current commit and its parent
35+
- name: "Show change commit"
36+
run: git log -1
3537
- uses: arduino/setup-protoc@v3
3638
with:
3739
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -42,11 +44,15 @@ jobs:
4244
with:
4345
cwd: opentelemetry
4446
branchName: ${{ env.BRANCH_NAME }}
47+
- name: "Checkout change commit"
48+
run: git checkout $GITHUB_SHA
4549
- uses: boa-dev/criterion-compare-action@v3
4650
with:
4751
cwd: opentelemetry-appender-tracing
4852
features: spec_unstable_logs_enabled
4953
branchName: ${{ env.BRANCH_NAME }}
54+
- name: "Checkout change commit"
55+
run: git checkout $GITHUB_SHA
5056
- uses: boa-dev/criterion-compare-action@v3
5157
with:
5258
cwd: opentelemetry-sdk

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
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 }}

.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: 2 additions & 3 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,

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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@ 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 }

0 commit comments

Comments
 (0)