Skip to content

Commit cfd4ef9

Browse files
committed
initial commit
1 parent 0202299 commit cfd4ef9

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::{MetricsError, Result},
11-
KeyValue,
10+
otel_warn, KeyValue,
1211
};
1312

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

0 commit comments

Comments
 (0)