Skip to content

Commit 088a700

Browse files
Dreisteindjc
authored andcommitted
Fix: use dedicated with_service_name in otlp example
1 parent 85e28ac commit 088a700

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/opentelemetry-otlp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use opentelemetry_sdk::{
55
Resource,
66
};
77
use opentelemetry_semantic_conventions::{
8-
attribute::{DEPLOYMENT_ENVIRONMENT_NAME, SERVICE_NAME, SERVICE_VERSION},
8+
attribute::{DEPLOYMENT_ENVIRONMENT_NAME, SERVICE_VERSION},
99
SCHEMA_URL,
1010
};
1111
use tracing_core::Level;
@@ -15,9 +15,9 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
1515
// Create a Resource that captures information about the entity for which telemetry is recorded.
1616
fn resource() -> Resource {
1717
Resource::builder()
18+
.with_service_name(env!("CARGO_PKG_NAME"))
1819
.with_schema_url(
1920
[
20-
KeyValue::new(SERVICE_NAME, env!("CARGO_PKG_NAME")),
2121
KeyValue::new(SERVICE_VERSION, env!("CARGO_PKG_VERSION")),
2222
KeyValue::new(DEPLOYMENT_ENVIRONMENT_NAME, "develop"),
2323
],

0 commit comments

Comments
 (0)