Skip to content

Commit

Permalink
Simplify OTLP example (#1926)
Browse files Browse the repository at this point in the history
  • Loading branch information
utpilla committed Jul 11, 2024
1 parent 3882b22 commit df815bd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions opentelemetry-otlp/examples/basic-otlp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,15 @@ fn init_metrics() -> Result<opentelemetry_sdk::metrics::SdkMeterProvider, Metric
endpoint: "http://localhost:4317".to_string(),
..ExportConfig::default()
};
let provider = opentelemetry_otlp::new_pipeline()
opentelemetry_otlp::new_pipeline()
.metrics(runtime::Tokio)
.with_exporter(
opentelemetry_otlp::new_exporter()
.tonic()
.with_export_config(export_config),
)
.with_resource(RESOURCE.clone())
.build();
match provider {
Ok(provider) => Ok(provider),
Err(err) => Err(err),
}
.build()
}

fn init_logs() -> Result<opentelemetry_sdk::logs::LoggerProvider, LogError> {
Expand Down

0 comments on commit df815bd

Please sign in to comment.