diff --git a/src/OpenTelemetry.Exporter.Console/CHANGELOG.md b/src/OpenTelemetry.Exporter.Console/CHANGELOG.md index 4ceccdca3c8..343846afe6d 100644 --- a/src/OpenTelemetry.Exporter.Console/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Console/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +Fix MetricExporter to respect Console and Debug flags. + ## 1.2.0-rc1 Released 2021-Nov-29 diff --git a/src/OpenTelemetry.Exporter.Console/ConsoleMetricExporter.cs b/src/OpenTelemetry.Exporter.Console/ConsoleMetricExporter.cs index 938cde89d6c..cd94194913f 100644 --- a/src/OpenTelemetry.Exporter.Console/ConsoleMetricExporter.cs +++ b/src/OpenTelemetry.Exporter.Console/ConsoleMetricExporter.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Globalization; using System.Text; using OpenTelemetry.Metrics; @@ -42,7 +41,7 @@ public override ExportResult Export(in Batch batch) { if (resourceAttribute.Key.Equals("service.name")) { - Console.WriteLine("Service.Name" + resourceAttribute.Value); + this.WriteLine("Service.Name" + resourceAttribute.Value); } } } @@ -73,7 +72,7 @@ public override ExportResult Export(in Batch batch) } } - Console.WriteLine(msg.ToString()); + this.WriteLine(msg.ToString()); foreach (ref readonly var metricPoint in metric.GetMetricPoints()) { @@ -174,7 +173,7 @@ public override ExportResult Export(in Batch batch) msg.Append(metric.MetricType); msg.AppendLine(); msg.Append($"Value: {valueDisplay}"); - Console.WriteLine(msg); + this.WriteLine(msg.ToString()); } }