From c6e358db307ad4346cb96bd588cdef37d82b5348 Mon Sep 17 00:00:00 2001 From: Lalit Date: Sun, 27 Oct 2024 18:10:30 -0700 Subject: [PATCH 01/16] initial commit --- .../src/trace/sampler/jaeger_remote/rate_limit.rs | 11 ++++++----- .../src/trace/sampler/jaeger_remote/sampler.rs | 10 ++++++++-- .../trace/sampler/jaeger_remote/sampling_strategy.rs | 11 ++++++----- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/rate_limit.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/rate_limit.rs index 436df8f096..0f32ca8e38 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/rate_limit.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/rate_limit.rs @@ -1,4 +1,3 @@ -use opentelemetry::trace::TraceError; use std::time::SystemTime; // leaky bucket based rate limit @@ -53,10 +52,12 @@ impl LeakyBucket { false } } - Err(_) => { - opentelemetry::global::handle_error(TraceError::Other( - "jaeger remote sampler gets rewinded timestamp".into(), - )); + Err(err) => { + opentelemetry::otel_debug!( + name: "JaegerRemoteSampler.LeakyBucket.ClockAdjustment", + message = "jaeger remote sampler detected a rewind in system clock", + reason = format!("{:?}", err), + ); true } } diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index 6f942cbd7f..01cd6c21ba 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -5,7 +5,7 @@ use crate::trace::{Sampler, ShouldSample}; use futures_util::{stream, StreamExt as _}; use http::Uri; use opentelemetry::trace::{Link, SamplingResult, SpanKind, TraceError, TraceId}; -use opentelemetry::{global, Context, KeyValue}; +use opentelemetry::{otel_debug, Context, KeyValue}; use opentelemetry_http::HttpClient; use std::str::FromStr; use std::sync::Arc; @@ -203,7 +203,13 @@ impl JaegerRemoteSampler { // send request match Self::request_new_strategy(&client, endpoint.clone()).await { Ok(remote_strategy_resp) => strategy.update(remote_strategy_resp), - Err(err_msg) => global::handle_error(TraceError::Other(err_msg.into())), + Err(err_msg) => { + otel_debug!( + name: "JaegerRemoteSampler.UpdateStrategy.RequestFailed", + reason = "Failed to fetch new sampling strategy", + error = format!("{}", err_msg), + ); + } }; } else { // shutdown diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index b48642d478..898d53033f 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -4,9 +4,9 @@ use crate::trace::sampler::jaeger_remote::remote::{ }; use crate::trace::sampler::sample_based_on_probability; use opentelemetry::trace::{ - SamplingDecision, SamplingResult, TraceContextExt, TraceError, TraceId, TraceState, + SamplingDecision, SamplingResult, TraceContextExt, TraceId, TraceState, }; -use opentelemetry::{global, Context}; +use opentelemetry::{otel_debug, Context}; use std::collections::HashMap; use std::fmt::{Debug, Formatter}; use std::sync::Mutex; @@ -107,9 +107,10 @@ impl Inner { } }) .unwrap_or_else(|_err| { - global::handle_error(TraceError::Other( - "jaeger remote sampler mutex poisoned".into(), - )) + otel_debug!( + name: "JaegerRemoteSampler.MutexPoisoned", + reason = "Failed to update strategy due to poisoned mutex" + ); }); } From 08ef266de1158807f1260adc1c76417a4f4e2c9c Mon Sep 17 00:00:00 2001 From: Lalit Date: Sun, 27 Oct 2024 18:12:03 -0700 Subject: [PATCH 02/16] change error to reason --- opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index 01cd6c21ba..01cd508158 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -206,8 +206,8 @@ impl JaegerRemoteSampler { Err(err_msg) => { otel_debug!( name: "JaegerRemoteSampler.UpdateStrategy.RequestFailed", - reason = "Failed to fetch new sampling strategy", - error = format!("{}", err_msg), + message = "Failed to fetch new sampling strategy", + reason = format!("{}", err_msg), ); } }; From 30f285c28debda83e1fc4d05c047dd6c48d91cff Mon Sep 17 00:00:00 2001 From: Lalit Date: Sun, 27 Oct 2024 21:36:37 -0700 Subject: [PATCH 03/16] Fix --- .../src/trace/sampler/jaeger_remote/sampler.rs | 6 +++--- .../sampler/jaeger_remote/sampling_strategy.rs | 14 +++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index 01cd508158..814ed07b71 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -5,7 +5,7 @@ use crate::trace::{Sampler, ShouldSample}; use futures_util::{stream, StreamExt as _}; use http::Uri; use opentelemetry::trace::{Link, SamplingResult, SpanKind, TraceError, TraceId}; -use opentelemetry::{otel_debug, Context, KeyValue}; +use opentelemetry::{otel_error, Context, KeyValue}; use opentelemetry_http::HttpClient; use std::str::FromStr; use std::sync::Arc; @@ -204,9 +204,9 @@ impl JaegerRemoteSampler { match Self::request_new_strategy(&client, endpoint.clone()).await { Ok(remote_strategy_resp) => strategy.update(remote_strategy_resp), Err(err_msg) => { - otel_debug!( + otel_error!( name: "JaegerRemoteSampler.UpdateStrategy.RequestFailed", - message = "Failed to fetch new sampling strategy", + message = "Failed to fetch new sampling strategy from remote endpoint. This may cause the sampler to use stale configuration until the next successful update.", reason = format!("{}", err_msg), ); } diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index 898d53033f..eda5fec8f6 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -6,7 +6,7 @@ use crate::trace::sampler::sample_based_on_probability; use opentelemetry::trace::{ SamplingDecision, SamplingResult, TraceContextExt, TraceId, TraceState, }; -use opentelemetry::{otel_debug, Context}; +use opentelemetry::{otel_warn, Context}; use std::collections::HashMap; use std::fmt::{Debug, Formatter}; use std::sync::Mutex; @@ -109,7 +109,7 @@ impl Inner { .unwrap_or_else(|_err| { otel_debug!( name: "JaegerRemoteSampler.MutexPoisoned", - reason = "Failed to update strategy due to poisoned mutex" + message = "Failed to update Jaeger Remote sampling strategy. The sampler's internal mutex is poisoned, indicating a panic occurred in another thread holding the lock. Sampling decisions may be using stale configuration.", ); }); } @@ -138,7 +138,15 @@ impl Inner { (_, _, Some(probabilistic)) => { Some(Strategy::Probabilistic(probabilistic.sampling_rate)) } - _ => None, + _ => { + otel_warn!( + name: "Sampler.JaegerRemote.InvalidStrategy", + message = "Received invalid sampling strategy from Jaeger remote endpoint. Expected one of: OperationSampling, RateLimitingSampling (max traces per second), or ProbabilisticSampling (0.0-1.0 sampling probability). No valid strategy was found in the response. Using previous strategy if available.", + received_operation_sampling = operation_sampling.is_some(), + received_rate_limiting = rate_limiting_sampling.is_some(), + received_probabilistic = probabilistic_sampling.is_some() + ); + } } } From 27558d9b31c5fbe6553dee320ca8c83dbb3ea13f Mon Sep 17 00:00:00 2001 From: Lalit Date: Sun, 27 Oct 2024 21:47:45 -0700 Subject: [PATCH 04/16] Review comment --- .../src/trace/sampler/jaeger_remote/sampling_strategy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index eda5fec8f6..d5cedae505 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -107,7 +107,7 @@ impl Inner { } }) .unwrap_or_else(|_err| { - otel_debug!( + otel_warn!( name: "JaegerRemoteSampler.MutexPoisoned", message = "Failed to update Jaeger Remote sampling strategy. The sampler's internal mutex is poisoned, indicating a panic occurred in another thread holding the lock. Sampling decisions may be using stale configuration.", ); From ecbf50e988c2898c3f37db0e845507ae693ec3d5 Mon Sep 17 00:00:00 2001 From: Lalit Date: Sun, 27 Oct 2024 21:50:27 -0700 Subject: [PATCH 05/16] keep mutex poisioning as otel_debug --- .../src/trace/sampler/jaeger_remote/sampling_strategy.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index d5cedae505..7214db7d18 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -6,7 +6,7 @@ use crate::trace::sampler::sample_based_on_probability; use opentelemetry::trace::{ SamplingDecision, SamplingResult, TraceContextExt, TraceId, TraceState, }; -use opentelemetry::{otel_warn, Context}; +use opentelemetry::{otel_debug, otel_warn, Context}; use std::collections::HashMap; use std::fmt::{Debug, Formatter}; use std::sync::Mutex; @@ -107,7 +107,7 @@ impl Inner { } }) .unwrap_or_else(|_err| { - otel_warn!( + otel_debug!( name: "JaegerRemoteSampler.MutexPoisoned", message = "Failed to update Jaeger Remote sampling strategy. The sampler's internal mutex is poisoned, indicating a panic occurred in another thread holding the lock. Sampling decisions may be using stale configuration.", ); From d4fe5a0b4fcbc6b0f47cfa30f19e095000cd85e0 Mon Sep 17 00:00:00 2001 From: Lalit Date: Sun, 27 Oct 2024 21:54:07 -0700 Subject: [PATCH 06/16] update comment --- .../src/trace/sampler/jaeger_remote/sampling_strategy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index 7214db7d18..5f86bf7519 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -109,7 +109,7 @@ impl Inner { .unwrap_or_else(|_err| { otel_debug!( name: "JaegerRemoteSampler.MutexPoisoned", - message = "Failed to update Jaeger Remote sampling strategy. The sampler's internal mutex is poisoned, indicating a panic occurred in another thread holding the lock. Sampling decisions may be using stale configuration.", + message = "Unable to update Jaeger Remote sampling strategy: the sampler's internal mutex is poisoned, likely due to a panic in another thread holding the lock. This may result in using stale configuration until the remote sampling client is restarted.", ); }); } From 796bf800af1deb5a5f996437948f09719f9cdd7e Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Sun, 27 Oct 2024 21:54:49 -0700 Subject: [PATCH 07/16] Update opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs Co-authored-by: Zhongyang Wu --- opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index 814ed07b71..c034a28d11 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -206,7 +206,7 @@ impl JaegerRemoteSampler { Err(err_msg) => { otel_error!( name: "JaegerRemoteSampler.UpdateStrategy.RequestFailed", - message = "Failed to fetch new sampling strategy from remote endpoint. This may cause the sampler to use stale configuration until the next successful update.", + message = "Failed to fetch the new sampling strategy from remote endpoint. This may cause the sampler to use stale configuration until the next successful update.", reason = format!("{}", err_msg), ); } From 182cd2ca2e47331b5101cd20861ab20091df9a8f Mon Sep 17 00:00:00 2001 From: Lalit Date: Sun, 27 Oct 2024 21:57:09 -0700 Subject: [PATCH 08/16] Fix --- opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index c034a28d11..686add82a7 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -204,7 +204,7 @@ impl JaegerRemoteSampler { match Self::request_new_strategy(&client, endpoint.clone()).await { Ok(remote_strategy_resp) => strategy.update(remote_strategy_resp), Err(err_msg) => { - otel_error!( + otel_warn!( name: "JaegerRemoteSampler.UpdateStrategy.RequestFailed", message = "Failed to fetch the new sampling strategy from remote endpoint. This may cause the sampler to use stale configuration until the next successful update.", reason = format!("{}", err_msg), From 12b00eb6d503d941d54bee0758f44e38195ae380 Mon Sep 17 00:00:00 2001 From: Lalit Date: Sun, 27 Oct 2024 22:07:11 -0700 Subject: [PATCH 09/16] fix build error --- opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs | 2 +- .../src/trace/sampler/jaeger_remote/sampling_strategy.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index 686add82a7..2322bd4987 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -5,7 +5,7 @@ use crate::trace::{Sampler, ShouldSample}; use futures_util::{stream, StreamExt as _}; use http::Uri; use opentelemetry::trace::{Link, SamplingResult, SpanKind, TraceError, TraceId}; -use opentelemetry::{otel_error, Context, KeyValue}; +use opentelemetry::{otel_warn, Context, KeyValue}; use opentelemetry_http::HttpClient; use std::str::FromStr; use std::sync::Arc; diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index 5f86bf7519..ca36e46fc7 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -142,10 +142,8 @@ impl Inner { otel_warn!( name: "Sampler.JaegerRemote.InvalidStrategy", message = "Received invalid sampling strategy from Jaeger remote endpoint. Expected one of: OperationSampling, RateLimitingSampling (max traces per second), or ProbabilisticSampling (0.0-1.0 sampling probability). No valid strategy was found in the response. Using previous strategy if available.", - received_operation_sampling = operation_sampling.is_some(), - received_rate_limiting = rate_limiting_sampling.is_some(), - received_probabilistic = probabilistic_sampling.is_some() ); + None } } } From c5e1e146c1972bc57b44f671e289a9790db1fc89 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Mon, 28 Oct 2024 10:27:03 -0700 Subject: [PATCH 10/16] update comments --- .../src/trace/sampler/jaeger_remote/sampler.rs | 2 +- .../src/trace/sampler/jaeger_remote/sampling_strategy.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index 2322bd4987..a97feac190 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -206,7 +206,7 @@ impl JaegerRemoteSampler { Err(err_msg) => { otel_warn!( name: "JaegerRemoteSampler.UpdateStrategy.RequestFailed", - message = "Failed to fetch the new sampling strategy from remote endpoint. This may cause the sampler to use stale configuration until the next successful update.", + message: "Failed to fetch the sampling strategy from the remote endpoint. The last successfully fetched configuration will be used if available; otherwise, the default sampler will be applied until a successful configuration fetch.", reason = format!("{}", err_msg), ); } diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index ca36e46fc7..cbef1f0f1c 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -107,9 +107,9 @@ impl Inner { } }) .unwrap_or_else(|_err| { - otel_debug!( + otel_warn!( name: "JaegerRemoteSampler.MutexPoisoned", - message = "Unable to update Jaeger Remote sampling strategy: the sampler's internal mutex is poisoned, likely due to a panic in another thread holding the lock. This may result in using stale configuration until the remote sampling client is restarted.", + message = "Unable to update Jaeger Remote sampling strategy: the sampler's internal mutex is poisoned, likely due to a panic in another thread holding the lock. The last known configuration will continue to be used until the remote sampling client is restarted.", ); }); } @@ -141,7 +141,7 @@ impl Inner { _ => { otel_warn!( name: "Sampler.JaegerRemote.InvalidStrategy", - message = "Received invalid sampling strategy from Jaeger remote endpoint. Expected one of: OperationSampling, RateLimitingSampling (max traces per second), or ProbabilisticSampling (0.0-1.0 sampling probability). No valid strategy was found in the response. Using previous strategy if available.", + message: "Invalid sampling strategy received from the remote endpoint. Expected one of: OperationSampling, RateLimitingSampling, or ProbabilisticSampling. Continuing to use the previous strategy or default sampler until a successful update.", ); None } From 2be11875fb49fefc51d0859ef7496683082a8332 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Mon, 28 Oct 2024 10:44:00 -0700 Subject: [PATCH 11/16] review comments --- .../src/trace/sampler/jaeger_remote/rate_limit.rs | 5 +++-- opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs | 2 +- .../src/trace/sampler/jaeger_remote/sampling_strategy.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/rate_limit.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/rate_limit.rs index 0f32ca8e38..62a8dfef02 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/rate_limit.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/rate_limit.rs @@ -8,6 +8,7 @@ pub(crate) struct LeakyBucket { bucket_size: f64, last_time: SystemTime, } +use opentelemetry::otel_debug; impl LeakyBucket { pub(crate) fn new(bucket_size: f64, span_per_sec: f64) -> LeakyBucket { @@ -53,9 +54,9 @@ impl LeakyBucket { } } Err(err) => { - opentelemetry::otel_debug!( + otel_debug!( name: "JaegerRemoteSampler.LeakyBucket.ClockAdjustment", - message = "jaeger remote sampler detected a rewind in system clock", + message = "Jaeger remote sampler detected a rewind in system clock", reason = format!("{:?}", err), ); true diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index a97feac190..beab97d437 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -206,7 +206,7 @@ impl JaegerRemoteSampler { Err(err_msg) => { otel_warn!( name: "JaegerRemoteSampler.UpdateStrategy.RequestFailed", - message: "Failed to fetch the sampling strategy from the remote endpoint. The last successfully fetched configuration will be used if available; otherwise, the default sampler will be applied until a successful configuration fetch.", + message= "Failed to fetch the sampling strategy from the remote endpoint. The last successfully fetched configuration will be used if available; otherwise, the default sampler will be applied until a successful configuration fetch.", reason = format!("{}", err_msg), ); } diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index cbef1f0f1c..6ac16e5da2 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -6,7 +6,7 @@ use crate::trace::sampler::sample_based_on_probability; use opentelemetry::trace::{ SamplingDecision, SamplingResult, TraceContextExt, TraceId, TraceState, }; -use opentelemetry::{otel_debug, otel_warn, Context}; +use opentelemetry::{otel_warn, Context}; use std::collections::HashMap; use std::fmt::{Debug, Formatter}; use std::sync::Mutex; @@ -141,7 +141,7 @@ impl Inner { _ => { otel_warn!( name: "Sampler.JaegerRemote.InvalidStrategy", - message: "Invalid sampling strategy received from the remote endpoint. Expected one of: OperationSampling, RateLimitingSampling, or ProbabilisticSampling. Continuing to use the previous strategy or default sampler until a successful update.", + message = "Invalid sampling strategy received from the remote endpoint. Expected one of: OperationSampling, RateLimitingSampling, or ProbabilisticSampling. Continuing to use the previous strategy or default sampler until a successful update.", ); None } From cd954f14bf837e114b98d7993ad834659bc0386a Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Mon, 28 Oct 2024 22:27:14 -0700 Subject: [PATCH 12/16] Update opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs Co-authored-by: Cijo Thomas --- opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index beab97d437..8911a40519 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -205,7 +205,7 @@ impl JaegerRemoteSampler { Ok(remote_strategy_resp) => strategy.update(remote_strategy_resp), Err(err_msg) => { otel_warn!( - name: "JaegerRemoteSampler.UpdateStrategy.RequestFailed", + name: "JaegerRemoteSampler.FailedToFetchSamplingStrategy", message= "Failed to fetch the sampling strategy from the remote endpoint. The last successfully fetched configuration will be used if available; otherwise, the default sampler will be applied until a successful configuration fetch.", reason = format!("{}", err_msg), ); From 0589012ecc35cab43ff13eeb03c60dfb53019f8b Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Mon, 28 Oct 2024 22:27:21 -0700 Subject: [PATCH 13/16] Update opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs Co-authored-by: Cijo Thomas --- .../src/trace/sampler/jaeger_remote/sampling_strategy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index 6ac16e5da2..1f71df7114 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -140,7 +140,7 @@ impl Inner { } _ => { otel_warn!( - name: "Sampler.JaegerRemote.InvalidStrategy", + name: "JaegerRemoteSampler.InvalidStrategyReceived", message = "Invalid sampling strategy received from the remote endpoint. Expected one of: OperationSampling, RateLimitingSampling, or ProbabilisticSampling. Continuing to use the previous strategy or default sampler until a successful update.", ); None From c0999d05bf818f716eb1213ee50fcf09d0634063 Mon Sep 17 00:00:00 2001 From: Lalit Date: Tue, 29 Oct 2024 00:17:38 -0700 Subject: [PATCH 14/16] changed mutex poisioning error message --- .../src/trace/sampler/jaeger_remote/sampling_strategy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index 1f71df7114..408dd49f92 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -109,7 +109,7 @@ impl Inner { .unwrap_or_else(|_err| { otel_warn!( name: "JaegerRemoteSampler.MutexPoisoned", - message = "Unable to update Jaeger Remote sampling strategy: the sampler's internal mutex is poisoned, likely due to a panic in another thread holding the lock. The last known configuration will continue to be used until the remote sampling client is restarted.", + message = "Unable to update Jaeger Remote sampling strategy: the sampler's internal mutex is poisoned, likely due to a panic in another thread holding the lock. The last known configuration will continue to be used until the application is restarted.", ); }); } From 6a8027499ed0b58063910aec91e207653fd46bbe Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 29 Oct 2024 12:02:18 -0700 Subject: [PATCH 15/16] Update opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs Co-authored-by: Cijo Thomas --- opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs index 8911a40519..1b7909f760 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampler.rs @@ -205,7 +205,7 @@ impl JaegerRemoteSampler { Ok(remote_strategy_resp) => strategy.update(remote_strategy_resp), Err(err_msg) => { otel_warn!( - name: "JaegerRemoteSampler.FailedToFetchSamplingStrategy", + name: "JaegerRemoteSampler.FailedToFetchStrategy", message= "Failed to fetch the sampling strategy from the remote endpoint. The last successfully fetched configuration will be used if available; otherwise, the default sampler will be applied until a successful configuration fetch.", reason = format!("{}", err_msg), ); From 788df4e85e8b87b222c6c09e3d3733fb8f6049c1 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 29 Oct 2024 12:05:28 -0700 Subject: [PATCH 16/16] review comment --- .../src/trace/sampler/jaeger_remote/sampling_strategy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs index 408dd49f92..0f1fd43679 100644 --- a/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs +++ b/opentelemetry-sdk/src/trace/sampler/jaeger_remote/sampling_strategy.rs @@ -109,7 +109,7 @@ impl Inner { .unwrap_or_else(|_err| { otel_warn!( name: "JaegerRemoteSampler.MutexPoisoned", - message = "Unable to update Jaeger Remote sampling strategy: the sampler's internal mutex is poisoned, likely due to a panic in another thread holding the lock. The last known configuration will continue to be used until the application is restarted.", + message = "Unable to update Jaeger Remote sampling strategy: the sampler's internal mutex is poisoned, likely due to a panic in another thread holding the lock. No further attempts to update the strategy will be made until the application or process restarts, and the last known configuration will continue to be used.", ); }); }