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; }