From 44f2029330af531f00884440232babd0aa819962 Mon Sep 17 00:00:00 2001 From: zhihanz Date: Wed, 29 Jun 2022 20:38:22 +0800 Subject: [PATCH 1/2] feat: support to configure jaeger agent endpoint for databend-query --- common/tracing/src/logging.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/tracing/src/logging.rs b/common/tracing/src/logging.rs index aec621ba2682..4bc1ee93c006 100644 --- a/common/tracing/src/logging.rs +++ b/common/tracing/src/logging.rs @@ -96,10 +96,12 @@ pub fn init_global_tracing( let mut jaeger_layer = None; let fuse_jaeger_env = env::var("DATABEND_JAEGER").unwrap_or_else(|_| "".to_string()); if !fuse_jaeger_env.is_empty() { + let jaeger_agent_endpoint = env::var("DATABEND_JAEGER_AGENT_ENDPOINT").unwrap_or_else(|_| "127.0.0.1:6831".to_string()); global::set_text_map_propagator(TraceContextPropagator::new()); let tracer = opentelemetry_jaeger::new_pipeline() .with_service_name(app_name) + .with_agent_endpoint(jaeger_agent_endpoint) .install_batch(opentelemetry::runtime::Tokio) .expect("install"); From 81a4d6e5a0101864f0a335e261527ae61e1fd2f4 Mon Sep 17 00:00:00 2001 From: zhihanz Date: Wed, 29 Jun 2022 21:10:31 +0800 Subject: [PATCH 2/2] chore: adopt user cloud identity and depreciate DATABEND_JAEGER env --- common/tracing/src/logging.rs | 6 +++--- query/bin/databend-query.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/tracing/src/logging.rs b/common/tracing/src/logging.rs index 4bc1ee93c006..23f8b32b1efb 100644 --- a/common/tracing/src/logging.rs +++ b/common/tracing/src/logging.rs @@ -94,9 +94,9 @@ pub fn init_global_tracing( // Jaeger layer. let mut jaeger_layer = None; - let fuse_jaeger_env = env::var("DATABEND_JAEGER").unwrap_or_else(|_| "".to_string()); - if !fuse_jaeger_env.is_empty() { - let jaeger_agent_endpoint = env::var("DATABEND_JAEGER_AGENT_ENDPOINT").unwrap_or_else(|_| "127.0.0.1:6831".to_string()); + let jaeger_agent_endpoint = + env::var("DATABEND_JAEGER_AGENT_ENDPOINT").unwrap_or_else(|_| "".to_string()); + if !jaeger_agent_endpoint.is_empty() { global::set_text_map_propagator(TraceContextPropagator::new()); let tracer = opentelemetry_jaeger::new_pipeline() diff --git a/query/bin/databend-query.rs b/query/bin/databend-query.rs index 300ba02ba0c0..934ce2bba004 100644 --- a/query/bin/databend-query.rs +++ b/query/bin/databend-query.rs @@ -50,8 +50,8 @@ async fn main(_global_tracker: Arc) -> common_exception::Result< } let app_name = format!( - "databend-query-{}@{}:{}", - conf.query.cluster_id, conf.query.mysql_handler_host, conf.query.mysql_handler_port + "databend-query-{}-{}@{}", + conf.query.tenant_id, conf.query.cluster_id, conf.query.flight_api_address ); let mut _sentry_guard = None;