Skip to content

Commit 78a09a8

Browse files
committed
simplify batch example
1 parent 40cb64e commit 78a09a8

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

opentelemetry-zipkin/CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
- Bump msrv to 1.75.0.
66
- **Breaking** The `opentelemetry_zipkin::new_pipeline()` interface is now replaced with `opentelemetry_zipkin::ZipkinExporter::builder()`.
7+
8+
Previous Signature:
9+
```rust
10+
let tracer = opentelemetry_zipkin::new_pipeline()
11+
.with_service_name("trace-demo")
12+
.install_simple()?;
13+
```
14+
Updated Signature:
15+
```rust
16+
let exporter = ZipkinExporter::builder()
17+
.with_service_name("trace-demo")
18+
.build()?;
19+
let provider = TracerProvider::builder()
20+
.with_simple_exporter(exporter)
21+
.build();
22+
let tracer = global::tracer("zipkin-tracer");
23+
```
724

825
## 0.27.0
926

opentelemetry-zipkin/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ bytes = { workspace = true }
4545
futures-util = { workspace = true, features = ["io"] }
4646
http-body-util = { workspace = true }
4747
hyper-util = { workspace = true, features = ["client-legacy", "http1", "tokio"] }
48-
opentelemetry_sdk = { default-features = false, features = ["experimental_trace_batch_span_processor_with_async_runtime", "trace", "testing"], path = "../opentelemetry-sdk" }
48+
opentelemetry_sdk = { default-features = false, features = ["trace", "testing"], path = "../opentelemetry-sdk" }
4949
temp-env = { workspace = true }

opentelemetry-zipkin/src/lib.rs

+4-16
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,13 @@
5252
//! ## Performance
5353
//!
5454
//! For optimal performance, a batch exporter is recommended as the simple exporter
55-
//! will export each span synchronously on drop. You can enable the [`rt-tokio`],
56-
//! [`rt-tokio-current-thread`] or [`rt-async-std`] features and specify a runtime
57-
//! on the trace provider builder to have a batch exporter configured for you
58-
//! automatically.
59-
//!
60-
//! ```toml
61-
//! [dependencies]
62-
//! opentelemetry = { version = "*", features = ["rt-tokio"] }
63-
//! opentelemetry-zipkin = { version = "*", features = ["reqwest-client"], default-features = false }
64-
//! ```
55+
//! will export each span synchronously on drop. You can achieve this by creating a
56+
//! `BatchSpanProcessor` and passing it to the trace provider.
6557
//!
6658
//! ```no_run
6759
//! use opentelemetry_sdk::{
68-
//! runtime::Tokio,
6960
//! trace::{
70-
//! span_processor_with_async_runtime::BatchSpanProcessor,
61+
//! BatchSpanProcessor,
7162
//! BatchConfigBuilder,
7263
//! TracerProvider,
7364
//! }
@@ -79,7 +70,7 @@
7970
//! .with_service_name("runtime-demo")
8071
//! .build()?;
8172
//!
82-
//! let batch = BatchSpanProcessor::builder(exporter, Tokio)
73+
//! let batch = BatchSpanProcessor::builder(exporter)
8374
//! .with_batch_config(BatchConfigBuilder::default().with_max_queue_size(4096).build())
8475
//! .build();
8576
//!
@@ -91,9 +82,6 @@
9182
//! }
9283
//! ```
9384
//!
94-
//! [`rt-tokio`]: https://tokio.rs
95-
//! [`async-std`]: https://async.rs
96-
//!
9785
//! ## Choosing an HTTP client
9886
//!
9987
//! The HTTP client that this exporter will use can be overridden using features

0 commit comments

Comments
 (0)