Skip to content

Commit c47ac41

Browse files
authored
Merge branch 'main' into cijothomas/metric-doc2
2 parents 9303e40 + 1f0d9a9 commit c47ac41

File tree

53 files changed

+1028
-325
lines changed

Some content is hidden

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

53 files changed

+1028
-325
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
with:
7373
toolchain: stable
7474
components: rustfmt, clippy
75-
- uses: taiki-e/install-action@33734a118689b0b418824fb78ea2bf18e970b43b # v2.50.4
75+
- uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
7676
with:
7777
tool: cargo-hack
7878
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
@@ -100,7 +100,7 @@ jobs:
100100
# https://github.com/awslabs/cargo-check-external-types/releases
101101
toolchain: nightly-2025-05-04
102102
components: rustfmt
103-
- uses: taiki-e/install-action@33734a118689b0b418824fb78ea2bf18e970b43b # v2.50.4
103+
- uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
104104
with:
105105
106106
- name: external-type-check
@@ -124,7 +124,7 @@ jobs:
124124
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
125125
with:
126126
toolchain: stable
127-
- uses: taiki-e/install-action@33734a118689b0b418824fb78ea2bf18e970b43b # v2.50.4
127+
- uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
128128
with:
129129
tool: cargo-msrv
130130
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
@@ -206,7 +206,7 @@ jobs:
206206
with:
207207
repo-token: ${{ secrets.GITHUB_TOKEN }}
208208
- name: Install cargo-llvm-cov
209-
uses: taiki-e/install-action@33734a118689b0b418824fb78ea2bf18e970b43b # v2.50.4
209+
uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
210210
with:
211211
tool: cargo-llvm-cov
212212
- name: cargo generate-lockfile
@@ -215,7 +215,7 @@ jobs:
215215
- name: cargo llvm-cov
216216
run: cargo llvm-cov --locked --all-features --workspace --lcov --lib --output-path lcov.info
217217
- name: Upload to codecov.io
218-
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
218+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
219219
env:
220220
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
221221
with:
@@ -224,8 +224,9 @@ jobs:
224224
runs-on: ubuntu-latest
225225
steps:
226226
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
227-
- uses: dtolnay/rust-toolchain@4305c38b25d97ef35a8ad1f985ccf2d2242004f2 # stable
227+
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # stable
228228
with:
229+
toolchain: stable
229230
components: rustfmt
230231
- uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
231232
with:
@@ -253,7 +254,7 @@ jobs:
253254
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
254255
with:
255256
toolchain: stable
256-
- uses: taiki-e/install-action@33734a118689b0b418824fb78ea2bf18e970b43b # v2.50.4
257+
- uses: taiki-e/install-action@735e5933943122c5ac182670a935f54a949265c1 # v2.52.4
257258
with:
258259
tool: cargo-machete
259260
- name: cargo machete

.github/workflows/fossa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121

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

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
persist-credentials: false
3131

32-
- uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
32+
- uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
3333
with:
3434
results_file: results.sarif
3535
results_format: sarif

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ sysinfo = "0.32"
7474
tempfile = "3.3.0"
7575
testcontainers = "0.23.1"
7676
tracing-log = "0.2"
77-
tracing-opentelemetry = "0.30"
77+
tracing-opentelemetry = "0.31"
7878
typed-builder = "0.20"
7979
uuid = "1.3"
8080

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ documentation.
3535
| Baggage | RC |
3636
| Propagators | Beta |
3737
| Logs-API | Stable* |
38-
| Logs-SDK | Stable |
38+
| Logs-SDK | Stable |
3939
| Logs-OTLP Exporter | RC |
4040
| Logs-Appender-Tracing | Stable |
4141
| Metrics-API | Stable |
42-
| Metrics-SDK | RC |
42+
| Metrics-SDK | Stable |
4343
| Metrics-OTLP Exporter | RC |
4444
| Traces-API | Beta |
4545
| Traces-SDK | Beta |

docs/release_0.30.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Release Notes 0.30
2+
3+
OpenTelemetry Rust 0.30 introduces a few breaking changes to the
4+
`opentelemetry_sdk` crate in the `metrics` feature. These changes were essential
5+
to drive the Metrics SDK towards stability. With this release, the Metrics SDK
6+
is officially declared stable. The Metrics API was declared stable last year,
7+
and previously, the Logs API, SDK, and OTel-Appender-Tracing were also marked
8+
stable. Importantly, no breaking changes have been introduced to components
9+
already marked as stable.
10+
11+
It is worth noting that the `opentelemetry-otlp` crate remains in a
12+
Release-Candidate state and is not yet considered stable. With the API and SDK
13+
for Logs and Metrics now stable, the focus will shift towards further refining
14+
and stabilizing the OTLP Exporters in upcoming releases. Additionally,
15+
Distributed Tracing is expected to progress towards stability, addressing key
16+
interoperability challenges.
17+
18+
For detailed changelogs of individual crates, please refer to their respective
19+
changelog files. This document serves as a summary of the main changes.
20+
21+
## Key Changes
22+
23+
### Metrics SDK Improvements
24+
25+
1. **Stabilized "view" features**: Previously under an experimental feature
26+
flag, views can now be used to modify the name, unit, description, and
27+
cardinality limit of a metric. Advanced view capabilities, such as changing
28+
aggregation or dropping attributes, remain under the experimental feature
29+
flag.
30+
31+
2. **Cardinality capping**: Introduced the ability to cap cardinality and
32+
configure limits using views.
33+
34+
3. **Polished public API**: Refined the public API to hide implementation
35+
details from exporters, enabling future internal optimizations and ensuring
36+
consistency. Some APIs related to authoring custom metric readers have been
37+
moved behind experimental feature flags. These advanced use cases require
38+
more time to finalize the API surface before being included in the stable
39+
release.
40+
41+
### Context-Based Suppression
42+
43+
Added the ability to suppress telemetry based on Context. This feature prevents
44+
telemetry-induced-telemetry scenarios and addresses a long-standing issue. Note
45+
that suppression relies on proper context propagation. Certain libraries used in
46+
OTLP Exporters utilize `tracing` but do not adopt OpenTelemetry's context
47+
propagation. As a result, not all telemetry is automatically suppressed with
48+
this feature. Improvements in this area are expected in future releases.
49+
50+
## Next Release
51+
52+
In the [next
53+
release](https://github.com/open-telemetry/opentelemetry-rust/milestone/22), the
54+
focus will shift to OTLP Exporters and Distributed Tracing, specifically
55+
resolving
56+
[interoperability](https://github.com/open-telemetry/opentelemetry-rust/issues/2420)
57+
issues with `tokio-tracing` and other fixes required to drive Distributed
58+
Tracing towards stability.
59+
60+
## Acknowledgments
61+
62+
Thank you to everyone who contributed to this milestone. We welcome your
63+
feedback through GitHub issues or discussions in the OTel-Rust Slack channel
64+
[here](https://cloud-native.slack.com/archives/C03GDP0H023).
65+
66+
We are also excited to announce that [Anton Grübel](https://github.com/gruebel)
67+
and [Björn Antonsson](https://github.com/bantonsson) have joined the OTel Rust
68+
project as Approvers.

examples/metrics-advanced/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,3 @@ Run the following, and the Metrics will be written out to stdout.
1212
```shell
1313
$ cargo run
1414
```
15-
16-
17-

examples/metrics-advanced/src/main.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,23 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
8585
.with_description("My histogram example description")
8686
.build();
8787

88-
// Record measurements using the histogram instrument.
89-
// This metric will have a cardinality limit of 2,
90-
// as set in the view. Because of this, only the first two
91-
// measurements will be recorded, and the rest will be folded
92-
// into the overflow attribute.
88+
// Record measurements using the histogram instrument. This metric will have
89+
// a cardinality limit of 2, as set in the view. Because of this, only the
90+
// first two distinct attribute combinations will be recorded, and the rest
91+
// will be folded into the overflow attribute. Any number of measurements
92+
// can be recorded as long as they use the same or already-seen attribute
93+
// combinations.
9394
histogram2.record(1.5, &[KeyValue::new("mykey1", "v1")]);
94-
9595
histogram2.record(1.2, &[KeyValue::new("mykey1", "v2")]);
9696

97+
// Repeatedly emitting measurements for "v1" and "v2" will not
98+
// trigger overflow, as they are already seen attribute combinations.
99+
histogram2.record(1.7, &[KeyValue::new("mykey1", "v1")]);
100+
histogram2.record(1.8, &[KeyValue::new("mykey1", "v2")]);
101+
102+
// Emitting measurements for new attribute combinations will trigger
103+
// overflow, as the cardinality limit of 2 has been reached.
104+
// All the below measurements will be folded into the overflow attribute.
97105
histogram2.record(1.23, &[KeyValue::new("mykey1", "v3")]);
98106

99107
histogram2.record(1.4, &[KeyValue::new("mykey1", "v4")]);
@@ -104,9 +112,9 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
104112

105113
histogram2.record(1.8, &[KeyValue::new("mykey1", "v7")]);
106114

107-
// Metrics are exported by default every 30 seconds when using stdout exporter,
115+
// Metrics are exported by default every 60 seconds when using stdout exporter,
108116
// however shutting down the MeterProvider here instantly flushes
109-
// the metrics, instead of waiting for the 30 sec interval.
117+
// the metrics, instead of waiting for the 60 sec interval.
110118
meter_provider.shutdown()?;
111119
Ok(())
112120
}

examples/metrics-basic/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@ Run the following, and the Metrics will be written out to stdout.
1111
```shell
1212
$ cargo run
1313
```
14-
15-
16-

examples/metrics-basic/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ async fn main() -> Result<(), Box<dyn Error>> {
136136
})
137137
.build();
138138

139-
// Metrics are exported by default every 30 seconds when using stdout
139+
// Metrics are exported by default every 60 seconds when using stdout
140140
// exporter, however shutting down the MeterProvider here instantly flushes
141-
// the metrics, instead of waiting for the 30 sec interval. Shutdown returns
141+
// the metrics, instead of waiting for the 60 sec interval. Shutdown returns
142142
// a result, which is bubbled up to the caller The commented code below
143143
// demonstrates handling the shutdown result, instead of bubbling up the
144144
// error.

0 commit comments

Comments
 (0)