Skip to content

Commit ce22d11

Browse files
committed
resource: add breaking to CHANGELOG
1 parent 83bc98f commit ce22d11

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

opentelemetry-sdk/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@
1111
- `ResourceDetector.detect()` no longer supports timeout option.
1212
- `opentelemetry::global::shutdown_tracer_provider()` Removed from the API, should now use `tracer_provider.shutdown()` see [#2369](https://github.com/open-telemetry/opentelemetry-rust/pull/2369) for a migration example. "Tracer provider" is cheaply cloneable, so users are encouraged to set a clone of it as the global (ex: `global::set_tracer_provider(provider.clone()))`, so that instrumentations and other components can obtain tracers from `global::tracer()`. The tracer_provider must be kept around to call shutdown on it at the end of application (ex: `tracer_provider.shutdown()`)
1313
- *Feature*: Add `ResourceBuilder` for an easy way to create new `Resource`s
14+
- *Breaking*: Remove `Resource::{new,empty,from_detectors,new_with_defaults,from_schema_url,merge,default}` from public api. To create Resources you should only use `Resource::builder()` or `Resource::builder_empty()`. See [#2322](https://github.com/open-telemetry/opentelemetry-rust/pull/2322) for a migration guide.
15+
Example Usage:
16+
```rust
17+
// old
18+
Resource::default().with_attributes(vec![
19+
KeyValue::new("service.name", "test_service"),
20+
KeyValue::new("key", "value"),
21+
]);
22+
23+
// new
24+
Resource::builder()
25+
.with_service_name("test_service")
26+
.with_attribute(KeyValue::new("key", "value"))
27+
.build();
28+
```
1429
- *Breaking* The LogExporter::export() method no longer requires a mutable reference to self.:
1530
Before:
1631
async fn export(&mut self, _batch: LogBatch<'_>) -> LogResult<()>

0 commit comments

Comments
 (0)