tracing: allow configuring service name

This is essential when consuming tracing data from multiple servers.
This commit is contained in:
Lambda 2024-08-24 18:59:36 +00:00
parent c355e2ad39
commit 14afa1357e
2 changed files with 11 additions and 8 deletions

View file

@ -178,6 +178,7 @@ pub(crate) struct OtelTraceConfig {
pub(crate) enable: bool,
pub(crate) filter: EnvFilterClone,
pub(crate) endpoint: Option<String>,
pub(crate) service_name: String,
}
impl Default for OtelTraceConfig {
@ -186,6 +187,7 @@ impl Default for OtelTraceConfig {
enable: false,
filter: default_tracing_filter(),
endpoint: None,
service_name: env!("CARGO_PKG_NAME").to_owned(),
}
}
}