From dc84c7d7088f95d7727456020bdff6056ffb0ffa Mon Sep 17 00:00:00 2001 From: Yun-Ting Lin Date: Fri, 8 Oct 2021 16:14:48 -0700 Subject: [PATCH] resolve conflicts --- src/OpenTelemetry/Metrics/MeterProviderSdk.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/OpenTelemetry/Metrics/MeterProviderSdk.cs b/src/OpenTelemetry/Metrics/MeterProviderSdk.cs index 49758781d2f..e11a75697e8 100644 --- a/src/OpenTelemetry/Metrics/MeterProviderSdk.cs +++ b/src/OpenTelemetry/Metrics/MeterProviderSdk.cs @@ -216,6 +216,7 @@ internal MeterProviderSdk( OpenTelemetrySdkEventSource.Log.MetricInstrumentIgnored(instrument.Name, instrument.Meter.Name, "Instrument belongs to a Meter not subscribed by the provider.", "Use AddMeter to add the Meter to the provider."); return; } + try { var metricName = instrument.Name; @@ -224,9 +225,7 @@ internal MeterProviderSdk( { if (this.metricStreamNames.ContainsKey(metricName)) { - // TODO: Log that instrument is ignored - // as the resulting Metric name is conflicting - // with existing name. + OpenTelemetrySdkEventSource.Log.MetricInstrumentIgnored(metricName, instrument.Meter.Name, "Metric name conflicting with existing name.", "Either change the name of the instrument or change name using View."); return; }