Skip to content

Commit 3bc9b3d

Browse files
authored
Global error handler cleanup - Metrics Pipeline (#2244)
1 parent 4a405fd commit 3bc9b3d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

opentelemetry-sdk/src/metrics/pipeline.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ use std::{
66
};
77

88
use opentelemetry::{
9-
global,
109
metrics::{MetricError, MetricResult},
11-
InstrumentationScope, KeyValue,
10+
otel_debug, InstrumentationScope, KeyValue,
1211
};
1312

1413
use crate::{
@@ -413,15 +412,18 @@ where
413412
if existing == id {
414413
return;
415414
}
416-
417-
global::handle_error(MetricError::Other(format!(
418-
"duplicate metric stream definitions, names: ({} and {}), descriptions: ({} and {}), kinds: ({:?} and {:?}), units: ({:?} and {:?}), and numbers: ({} and {})",
415+
// If an existing instrument with the same name but different attributes is found,
416+
// log a warning with details about the conflicting metric stream definitions.
417+
otel_debug!(
418+
name: "Instrument.DuplicateMetricStreamDefinitions",
419+
message = "duplicate metric stream definitions",
420+
reason = format!("names: ({} and {}), descriptions: ({} and {}), kinds: ({:?} and {:?}), units: ({:?} and {:?}), and numbers: ({} and {})",
419421
existing.name, id.name,
420422
existing.description, id.description,
421423
existing.kind, id.kind,
422424
existing.unit, id.unit,
423-
existing.number, id.number,
424-
)))
425+
existing.number, id.number,)
426+
);
425427
}
426428
}
427429
}

0 commit comments

Comments
 (0)