Skip to content

Commit 9289e3a

Browse files
authored
Merge branch 'main' into experimental-runtime
2 parents d6e0403 + a719d0d commit 9289e3a

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

opentelemetry-sdk/CHANGELOG.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
- *Breaking* Removed the following deprecated methods:
4545
- `Logger::provider()` : Previously deprecated in version 0.27.1
4646
- `Logger::instrumentation_scope()` : Previously deprecated in version 0.27.1.
47-
Migration Guidance:
47+
Migration Guidance:
4848
- These methods were intended for log appenders. Keep the clone of the provider handle, instead of depending on above methods.
4949

5050
- *Breaking* - `PeriodicReader` Updates
@@ -62,7 +62,7 @@
6262
1. *Default Implementation, requires no async runtime* (**Recommended**) The
6363
new default implementation does not require a runtime argument. Replace the
6464
builder method accordingly:
65-
- *Before:*
65+
- *Before:*
6666
```rust
6767
let reader = opentelemetry_sdk::metrics::PeriodicReader::builder(exporter, runtime::Tokio).build();
6868
```
@@ -75,7 +75,7 @@
7575
If your application cannot spin up new threads or you prefer using async
7676
runtimes, enable the
7777
"experimental_metrics_periodicreader_with_async_runtime" feature flag and
78-
adjust code as below.
78+
adjust code as below.
7979

8080
- *Before:*
8181
```rust
@@ -85,11 +85,11 @@
8585
- *After:*
8686
```rust
8787
let reader = opentelemetry_sdk::metrics::periodic_reader_with_async_runtime::PeriodicReader::builder(exporter, runtime::Tokio).build();
88-
```
88+
```
8989

9090
*Requirements:*
9191
- Enable the feature flag:
92-
`experimental_metrics_periodicreader_with_async_runtime`.
92+
`experimental_metrics_periodicreader_with_async_runtime`.
9393
- Continue enabling one of the async runtime feature flags: `rt-tokio`,
9494
`rt-tokio-current-thread`, or `rt-async-std`.
9595

@@ -104,7 +104,7 @@
104104
- Getter methods have been introduced to access field values.
105105
This change impacts custom exporter and processor developers by requiring updates to code that directly accessed LogRecord fields. They must now use the provided getter methods (e.g., `log_record.event_name()` instead of `log_record.event_name`).
106106

107-
- Upgrade the tracing crate used for internal logging to version 0.1.40 or later. This is necessary because the internal logging macros utilize the name field as
107+
- Upgrade the tracing crate used for internal logging to version 0.1.40 or later. This is necessary because the internal logging macros utilize the name field as
108108
metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/open-telemetry/opentelemetry-rust/pull/2418)
109109

110110
- **Breaking** [#2436](https://github.com/open-telemetry/opentelemetry-rust/pull/2436)
@@ -155,7 +155,7 @@ metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/ope
155155

156156
*Requirements:*
157157
- Enable the feature flag:
158-
`experimental_logs_batch_log_processor_with_async_runtime`.
158+
`experimental_logs_batch_log_processor_with_async_runtime`.
159159
- Continue enabling one of the async runtime feature flags: `rt-tokio`,
160160
`rt-tokio-current-thread`, or `rt-async-std`.
161161

@@ -207,13 +207,15 @@ metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/ope
207207

208208
*Requirements:*
209209
- Enable the feature flag:
210-
`experimental_trace_batch_span_processor_with_async_runtime`.
210+
`experimental_trace_batch_span_processor_with_async_runtime`.
211211
- Continue enabling one of the async runtime feature flags: `rt-tokio`,
212212
`rt-tokio-current-thread`, or `rt-async-std`.
213213

214214
- Bug fix: Empty Tracer names are retained as-is instead of replacing with
215215
"rust.opentelemetry.io/sdk/tracer"
216216
[#2486](https://github.com/open-telemetry/opentelemetry-rust/pull/2486)
217+
- Update `EnvResourceDetector` to allow resource attribute values containing
218+
equal signs (`"="`). [#2120](https://github.com/open-telemetry/opentelemetry-rust/pull/2120)
217219

218220
- **Breaking** Introduced `experimental_async_runtime` feature for runtime-specific traits.
219221
- Runtime-specific features (`rt-tokio`, `rt-tokio-current-thread`, and `rt-async-std`)
@@ -260,10 +262,10 @@ Released 2024-Nov-27
260262
- Bug fix: Empty Logger names are retained as-is instead of replacing with
261263
"rust.opentelemetry.io/sdk/logger"
262264
[#2316](https://github.com/open-telemetry/opentelemetry-rust/pull/2316)
263-
265+
264266
- `Logger::provider`: This method is deprecated as of version `0.27.1`. To be removed in `0.28.0`.
265267
- `Logger::instrumentation_scope`: This method is deprecated as of version `0.27.1`. To be removed in `0.28.0`
266-
Migration Guidance:
268+
Migration Guidance:
267269
- These methods are intended for log appenders. Keep the clone of the provider handle, instead of depending on above methods.
268270

269271

@@ -289,7 +291,7 @@ Released 2024-Nov-11
289291
- **Replaced**
290292
- ([#2217](https://github.com/open-telemetry/opentelemetry-rust/pull/2217)): Removed `{Delta,Cumulative}TemporalitySelector::new()` in favor of directly using `Temporality` enum to simplify the configuration of MetricsExporterBuilder with different temporalities.
291293
- **Renamed**
292-
- ([#2232](https://github.com/open-telemetry/opentelemetry-rust/pull/2232)): The `init` method used to create instruments has been renamed to `build`.
294+
- ([#2232](https://github.com/open-telemetry/opentelemetry-rust/pull/2232)): The `init` method used to create instruments has been renamed to `build`.
293295
Before:
294296
```rust
295297
let counter = meter.u64_counter("my_counter").init();

opentelemetry-sdk/src/resource/env.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ impl Default for EnvResourceDetector {
4545
fn construct_otel_resources(s: String) -> Resource {
4646
Resource::builder_empty()
4747
.with_attributes(s.split_terminator(',').filter_map(|entry| {
48-
let mut parts = entry.splitn(2, '=');
49-
let key = parts.next()?.trim();
50-
let value = parts.next()?.trim();
51-
if value.find('=').is_some() {
52-
return None;
53-
}
48+
let parts = match entry.split_once('=') {
49+
Some(p) => p,
50+
None => return None,
51+
};
52+
let key = parts.0.trim();
53+
let value = parts.1.trim();
5454

5555
Some(KeyValue::new(key.to_owned(), value.to_owned()))
5656
}))
@@ -106,7 +106,7 @@ mod tests {
106106
[
107107
(
108108
"OTEL_RESOURCE_ATTRIBUTES",
109-
Some("key=value, k = v , a= x, a=z"),
109+
Some("key=value, k = v , a= x, a=z,base64=SGVsbG8sIFdvcmxkIQ=="),
110110
),
111111
("IRRELEVANT", Some("20200810")),
112112
],
@@ -121,6 +121,7 @@ mod tests {
121121
KeyValue::new("k", "v"),
122122
KeyValue::new("a", "x"),
123123
KeyValue::new("a", "z"),
124+
KeyValue::new("base64", "SGVsbG8sIFdvcmxkIQ=="), // base64('Hello, World!')
124125
])
125126
.build()
126127
);

0 commit comments

Comments
 (0)