|
21 | 21 | //! $ docker run -p 4317:4317 otel/opentelemetry-collector:latest |
22 | 22 | //! ``` |
23 | 23 | //! |
24 | | -//! Then install a new pipeline with the recommended defaults to start exporting |
25 | | -//! telemetry. You will have to build a OTLP exporter first. |
| 24 | +//! Then create a new `Exporter`, and `Provider` with the recommended defaults to start exporting |
| 25 | +//! telemetry. |
26 | 26 | //! |
27 | | -//! Exporting pipelines can be started with `new_pipeline().tracing()` and |
28 | | -//! `new_pipeline().metrics()`, and `new_pipeline().logging()` respectively for |
29 | | -//! traces, metrics and logs. |
| 27 | +//! You will have to build a OTLP exporter first. Create the correct exporter based on the signal |
| 28 | +//! you are looking to export `SpanExporter::builder()`, `MetricsExporter::builder()`, |
| 29 | +//! `LogExporter::builder()` respectively for traces, metrics, and logs. |
| 30 | +//! |
| 31 | +//! Once you have the exporter, you can create your `Provider` by starting with `TracerProvider::builder()`, |
| 32 | +//! `SdkMeterProvider::builder()`, and `LoggerProvider::builder()` respectively for traces, metrics, and logs. |
30 | 33 | //! |
31 | 34 | //! ```no_run |
32 | 35 | //! # #[cfg(all(feature = "trace", feature = "grpc-tonic"))] |
|
37 | 40 | //! fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> { |
38 | 41 | //! // First, create a OTLP exporter builder. Configure it as you need. |
39 | 42 | //! let otlp_exporter = opentelemetry_otlp::SpanExporter::builder().with_tonic().build()?; |
40 | | -//! // Then pass it into pipeline builder |
| 43 | +//! // Then pass it into provider builder |
41 | 44 | //! let _ = opentelemetry_sdk::trace::TracerProvider::builder() |
42 | 45 | //! .with_simple_exporter(otlp_exporter) |
43 | 46 | //! .build(); |
|
74 | 77 | //! opentelemetry_otlp::SpanExporter::builder() |
75 | 78 | //! .with_tonic() |
76 | 79 | //! .build()?, |
77 | | -//! opentelemetry_sdk::runtime::AsyncStd, |
| 80 | +//! opentelemetry_sdk::runtime::Tokio, |
78 | 81 | //! ) |
79 | 82 | //! .build(); |
80 | 83 | //! |
|
0 commit comments