Skip to content

Commit a16e50c

Browse files
committed
add changelog
1 parent 2ab143c commit a16e50c

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

opentelemetry-sdk/CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,58 @@ metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/ope
159159
- Continue enabling one of the async runtime feature flags: `rt-tokio`,
160160
`rt-tokio-current-thread`, or `rt-async-std`.
161161

162+
- **Breaking** [#2456](https://github.com/open-telemetry/opentelemetry-rust/pull/2456)
163+
164+
`BatchSpanProcessor` no longer requires an async runtime by default. Instead, a dedicated
165+
background thread is created to do the batch processing and exporting.
166+
167+
For users who prefer the previous behavior of relying on a specific
168+
`Runtime`, they can do so by enabling the feature flag
169+
**`experimental_trace_batch_span_processor_with_async_runtime`**.
170+
171+
1. *Default Implementation, requires no async runtime* (**Recommended**) The
172+
new default implementation does not require a runtime argument. Replace the
173+
builder method accordingly:
174+
- *Before:*
175+
```rust
176+
let tracer_provider = TracerProvider::builder()
177+
.with_span_processor(BatchSpanProcessor::builder(exporter, runtime::Tokio).build())
178+
.build();
179+
```
180+
181+
- *After:*
182+
```rust
183+
let tracer_provider = TracerProvider::builder()
184+
.with_span_processor(BatchSpanProcessor::builder(exporter).build())
185+
.build();
186+
```
187+
188+
2. *Async Runtime Support*
189+
If your application cannot spin up new threads or you prefer using async
190+
runtimes, enable the
191+
"experimental_trace_batch_span_processor_with_async_runtime" feature flag and
192+
adjust code as below.
193+
194+
- *Before:*
195+
```rust
196+
let tracer_provider = TracerProvider::builder()
197+
.with_span_processor(BatchSpanProcessor::builder(exporter, runtime::Tokio).build())
198+
.build();
199+
```
200+
201+
- *After:*
202+
```rust
203+
let tracer_provider = TracerProvider::builder()
204+
.with_span_processor(span_processor_with_async_runtime::BatchSpanProcessor::builder(exporter, runtime::Tokio).build())
205+
.build();
206+
```
207+
208+
*Requirements:*
209+
- Enable the feature flag:
210+
`experimental_trace_batch_span_processor_with_async_runtime`.
211+
- Continue enabling one of the async runtime feature flags: `rt-tokio`,
212+
`rt-tokio-current-thread`, or `rt-async-std`.
213+
162214
## 0.27.1
163215

164216
Released 2024-Nov-27

0 commit comments

Comments
 (0)