Skip to content

Commit f3f4217

Browse files
committed
Stop using deprecated method in opentelmetry traceprovider
Signed-off-by: Simon Davies <[email protected]>
1 parent 6c99cbd commit f3f4217

File tree

1 file changed

+4
-10
lines changed
  • src/hyperlight_host/examples/otlp_tracing

1 file changed

+4
-10
lines changed

src/hyperlight_host/examples/otlp_tracing/main.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use opentelemetry_otlp::{SpanExporter, WithExportConfig};
3838
use opentelemetry_sdk::runtime::Tokio;
3939
use opentelemetry_sdk::{trace, Resource};
4040
use opentelemetry_semantic_conventions::attribute::{SERVICE_NAME, SERVICE_VERSION};
41-
use opentelemetry_semantic_conventions::SCHEMA_URL;
4241
use tracing_subscriber::EnvFilter;
4342
use uuid::Uuid;
4443

@@ -64,15 +63,10 @@ fn init_tracing_subscriber(addr: &str) -> Result<(), Box<dyn Error + Send + Sync
6463
.build()?;
6564

6665
let provider = trace::TracerProvider::builder()
67-
.with_config(
68-
trace::Config::default().with_resource(Resource::from_schema_url(
69-
vec![
70-
KeyValue::new(SERVICE_NAME, "hyperlight_otel_example"),
71-
KeyValue::new(SERVICE_VERSION, env!("CARGO_PKG_VERSION")),
72-
],
73-
SCHEMA_URL,
74-
)),
75-
)
66+
.with_resource(Resource::new(vec![
67+
KeyValue::new(SERVICE_NAME, "hyperlight_otel_example"),
68+
KeyValue::new(SERVICE_VERSION, env!("CARGO_PKG_VERSION")),
69+
]))
7670
.with_batch_exporter(exporter, Tokio)
7771
.build();
7872

0 commit comments

Comments
 (0)