Skip to content

Commit 5a29bf5

Browse files
authored
Merge branch 'main' into cijothomas/context-suppress
2 parents fb73294 + 369b952 commit 5a29bf5

File tree

61 files changed

+1963
-770
lines changed

Some content is hidden

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

61 files changed

+1963
-770
lines changed

.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+
jobs:
17+
runBenchmark:
18+
name: run benchmark
19+
permissions:
20+
pull-requests: write
21+
22+
# If we're running on a PR, use ubuntu-latest - a shared runner. We can't use the self-hosted
23+
# runners on arbitrary PRs, and we don't want to unleash that load on the pool anyway.
24+
# 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' }}
26+
if: ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'performance')) || github.event_name == 'push' }}
27+
env:
28+
# For PRs, compare against the base branch - e.g., 'main'.
29+
# For pushes to main, compare against the previous commit
30+
BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.base_ref || github.event.before }}
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 10 # Fetch current commit and its parent
35+
- uses: arduino/setup-protoc@v3
36+
with:
37+
repo-token: ${{ secrets.GITHUB_TOKEN }}
38+
- uses: dtolnay/rust-toolchain@master
39+
with:
40+
toolchain: stable
41+
- uses: boa-dev/criterion-compare-action@v3
42+
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
54+
branchName: ${{ env.BRANCH_NAME }}

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ jobs:
6262
- uses: arduino/setup-protoc@v3
6363
with:
6464
repo-token: ${{ secrets.GITHUB_TOKEN }}
65-
- uses: actions-rs/cargo@v1
66-
with:
67-
command: fmt
68-
args: --all -- --check
65+
- name: Format
66+
run: cargo fmt --all -- --check
6967
- name: Lint
7068
run: bash ./scripts/lint.sh
7169
external-types:

.github/workflows/pr_criterion.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ documentation.
3131
| Signal/Component | Overall Status |
3232
| -------------------- | ------------------ |
3333
| Context | Beta |
34-
| Baggage | Beta |
34+
| Baggage | RC |
3535
| Propagators | Beta |
3636
| Logs-API | Stable* |
37-
| Logs-SDK | RC |
37+
| Logs-SDK | Stable |
3838
| Logs-OTLP Exporter | RC |
39-
| Logs-Appender-Tracing | RC |
39+
| Logs-Appender-Tracing | Stable |
4040
| Metrics-API | Stable |
4141
| Metrics-SDK | RC |
4242
| Metrics-OTLP Exporter | RC |

docs/migration_0.29.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Migration Guide from 0.28 to 0.29
2+
3+
OpenTelemetry Rust 0.29 introduces a few breaking changes. This guide aims to
4+
facilitate a smooth migration for common use cases involving the
5+
`opentelemetry`, `opentelemetry_sdk`, `opentelemetry-otlp`, and
6+
`opentelemetry-appender-tracing` crates. For a comprehensive list of changes,
7+
please refer to the detailed changelog for each crate. This document covers only
8+
the most common scenarios. Note that changes that only affect custom
9+
exporter/processor authors are not mentioned in this doc.
10+
11+
OpenTelemetry Metrics API and Log-Bridge API were declared stable in 0.28, and have
12+
no breaking changes.
13+
14+
## Baggage Changes
15+
16+
The Baggage API has been redesigned to align with the OpenTelemetry
17+
specification. While the core API for interacting with Baggage remains the same,
18+
the accepted data types have changed. Baggage Keys now only allow strings (ASCII
19+
printable characters), and Baggage values are restricted to strings.
20+
21+
For detailed changes, see the [changelog](../opentelemetry/CHANGELOG.md). With
22+
version 0.29, the Baggage API has reached "Release Candidate" status, meaning
23+
further breaking changes will be highly restricted.
24+
25+
## Appender-Tracing Changes
26+
27+
The `opentelemetry-appender-tracing` crate, which bridges `tracing` events to
28+
OpenTelemetry logs, has been updated to properly map `tracing` data types to the
29+
OpenTelemetry model. As of version 0.29, this crate is considered "Stable," and
30+
no further breaking changes will be made without a major version bump.
31+
32+
## Configuration via Environment Variables
33+
34+
The 0.29 release aligns OpenTelemetry Rust with the rest of the OpenTelemetry
35+
ecosystem by treating any code-based configuration as final (i.e., it cannot be
36+
overridden by environment variables). This policy was partially true before but
37+
is now applied consistently. If you prefer to configure your application via
38+
environment variables, avoid configuring it programmatically.
39+
40+
## Discontinuing Dedicated Prometheus Exporter
41+
42+
The `opentelemetry-prometheus` crate will be discontinued with the 0.29 release.
43+
Active development on this crate ceased a few months ago. Given that Prometheus
44+
now natively supports OTLP, and considering that the OpenTelemetry Rust project
45+
is still working towards a 1.0 release, we need to focus on essential components
46+
to maintain scope and ensure timely delivery.
47+
48+
Prometheus interoperability remains a key goal for OpenTelemetry. However, the
49+
current `opentelemetry-prometheus` crate requires a major rewrite to eliminate
50+
dependencies on unmaintained crates. We may reintroduce a dedicated Prometheus
51+
exporter in the future once these issues are resolved.
52+
53+
### Migration Guide
54+
55+
For those using Prometheus as a backend, you can integrate with Prometheus using
56+
the following methods:
57+
58+
1. Use the OTLP Exporter to push metrics directly to Prometheus.
59+
2. If you require a pull (scrape) model, push metrics to an OpenTelemetry
60+
Collector using the OTLP Exporter, and configure Prometheus to scrape the
61+
OpenTelemetry Collector.
62+
63+
These alternatives ensure continued Prometheus integration while allowing us to
64+
focus on achieving a stable 1.0 release for OpenTelemetry Rust.
65+
66+
## Next Release
67+
68+
In the [next
69+
release](https://github.com/open-telemetry/opentelemetry-rust/milestone/21), we
70+
expect to stabilize the Metrics SDK and resolve the long-standing question of
71+
`tokio-tracing` vs. `opentelemetry tracing`, which is a prerequisite before
72+
stabilizing Distributed Tracing. Additionally, `Context` is also expected to be
73+
enhanced with the ability to suppress telemetry-induced-telemetry.
74+
75+
## Instrumentation Libraries
76+
77+
Unlike other OpenTelemetry language implementations, OpenTelemetry Rust historically did not
78+
maintain any instrumentations directly. This has recently changed with a
79+
[contribution](https://github.com/open-telemetry/opentelemetry-rust-contrib/pull/202)
80+
from one of the founding members of the OpenTelemetry Rust project to the
81+
contrib repository, providing an instrumentation library for
82+
[`actix-web`](https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/actix-web-opentelemetry).
83+
We expect that this instrumentation will serve as a reference implementation demonstrating best practices for
84+
creating OpenTelemetry instrumentations in Rust.
85+
86+
We welcome additional contributions of instrumentation libraries to the contrib repository.
87+
88+
## Thanks
89+
90+
Thank you to everyone who contributed to this milestone. Please share your feedback
91+
through GitHub issues or join the discussion in the OTel-Rust Slack channel
92+
[here](https://cloud-native.slack.com/archives/C03GDP0H023).

opentelemetry-appender-log/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
## vNext
44

5+
## 0.29.0
6+
7+
Released 2025-Mar-21
8+
59
- Similar to the `opentelemetry-appender-tracing` fix [2658](https://github.com/open-telemetry/opentelemetry-rust/issues/2658)
610
InstrumentationScope(Logger) used by the appender now uses an empty ("") named Logger.
711
Previously, a Logger with name and version of the crate was used.
812
Receivers (processors, exporters) are expected to use `LogRecord.target()` as scope name.
913
This is already done in OTLP Exporters, so this change should be transparent to most users.
14+
- Update `opentelemetry` dependency version to 0.29.
15+
- Update `opentelemetry-semantic-conventions` dependency version to 0.29.
1016

1117
## 0.28.0
1218

opentelemetry-appender-log/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "opentelemetry-appender-log"
3-
version = "0.28.0"
3+
version = "0.29.0"
44
description = "An OpenTelemetry appender for the log crate"
55
homepage = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-appender-log"
66
repository = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-appender-log"
@@ -11,12 +11,12 @@ rust-version = "1.75.0"
1111
edition = "2021"
1212

1313
[dependencies]
14-
opentelemetry = { version = "0.28", path = "../opentelemetry", features = [
14+
opentelemetry = { version = "0.29", path = "../opentelemetry", features = [
1515
"logs",
1616
] }
1717
log = { workspace = true, features = ["kv", "std"] }
1818
serde = { workspace = true, optional = true, features = ["std"] }
19-
opentelemetry-semantic-conventions = { version = "0.28", path = "../opentelemetry-semantic-conventions", optional = true, features = [
19+
opentelemetry-semantic-conventions = { version = "0.29", path = "../opentelemetry-semantic-conventions", optional = true, features = [
2020
"semconv_experimental",
2121
] }
2222

opentelemetry-appender-tracing/CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## vNext
44

5+
## 0.29.0
6+
7+
Released 2025-Mar-21
8+
59
Fixes [1682](https://github.com/open-telemetry/opentelemetry-rust/issues/1682).
610
"spec_unstable_logs_enabled" feature now do not suppress logs for other layers.
711

@@ -42,13 +46,18 @@ transparent to most users.
4246
implementations (SDK, processor, exporters) to leverage this additional
4347
information to determine if an event is enabled.
4448

45-
- `u64` and `usize` values are stored as `opentelemetry::logs::AnyValue::Int`
49+
- `u64`, `i128`, `u128` and `usize` values are stored as `opentelemetry::logs::AnyValue::Int`
4650
when conversion is feasible. Otherwise stored as
4751
`opentelemetry::logs::AnyValue::String`. This avoids unnecessary string
4852
allocation when values can be represented in their original types.
4953
- Byte arrays are stored as `opentelemetry::logs::AnyValue::Bytes` instead
5054
of string.
55+
- `Error` fields are reported using attribute named "exception.message". For
56+
example, the below will now report an attribute named "exception.message",
57+
instead of previously reporting the user provided attribute "error".
58+
`error!(....error = &OTelSdkError::AlreadyShutdown as &dyn std::error::Error...)`
5159
- perf - small perf improvement by avoiding string allocation of `target`
60+
- Update `opentelemetry` dependency version to 0.29.
5261

5362
## 0.28.1
5463

opentelemetry-appender-tracing/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "opentelemetry-appender-tracing"
3-
version = "0.28.1"
3+
version = "0.29.0"
44
edition = "2021"
55
description = "An OpenTelemetry log appender for the tracing crate"
66
homepage = "https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-appender-tracing"
@@ -12,12 +12,12 @@ rust-version = "1.75.0"
1212

1313
[dependencies]
1414
log = { workspace = true, optional = true }
15-
opentelemetry = { version = "0.28", path = "../opentelemetry", features = ["logs"] }
15+
opentelemetry = { version = "0.29", path = "../opentelemetry", features = ["logs"] }
1616
tracing = { workspace = true, features = ["std"]}
1717
tracing-core = { workspace = true }
1818
tracing-log = { workspace = true, optional = true }
1919
tracing-subscriber = { workspace = true, features = ["registry", "std"] }
20-
tracing-opentelemetry = { workspace = true, optional = true }
20+
# tracing-opentelemetry = { workspace = true, optional = true }
2121

2222
[dev-dependencies]
2323
log = { workspace = true }
@@ -36,7 +36,8 @@ pprof = { version = "0.14", features = ["flamegraph", "criterion"] }
3636
default = []
3737
experimental_metadata_attributes = ["dep:tracing-log"]
3838
spec_unstable_logs_enabled = ["opentelemetry/spec_unstable_logs_enabled"]
39-
experimental_use_tracing_span_context = ["tracing-opentelemetry"]
39+
# TODO - Enable this in 0.29.1 (once tracing-opentelemetry v0.30 is released)
40+
# experimental_use_tracing_span_context = ["tracing-opentelemetry"]
4041

4142

4243
[[bench]]

0 commit comments

Comments
 (0)