diff --git a/src/OpenTelemetry.Exporter.Console/CHANGELOG.md b/src/OpenTelemetry.Exporter.Console/CHANGELOG.md index 343846afe6d..7c45dfebf35 100644 --- a/src/OpenTelemetry.Exporter.Console/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Console/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased Fix MetricExporter to respect Console and Debug flags. +Added `Activity.Links` support to `ConsoleActivityExporter`. ## 1.2.0-rc1 diff --git a/src/OpenTelemetry.Exporter.Console/ConsoleActivityExporter.cs b/src/OpenTelemetry.Exporter.Console/ConsoleActivityExporter.cs index e52497ba6a5..d24317b1f16 100644 --- a/src/OpenTelemetry.Exporter.Console/ConsoleActivityExporter.cs +++ b/src/OpenTelemetry.Exporter.Console/ConsoleActivityExporter.cs @@ -73,6 +73,15 @@ public override ExportResult Export(in Batch batch) } } + if (activity.Links.Any()) + { + this.WriteLine("Activity.Links:"); + foreach (var activityLink in activity.Links) + { + this.WriteLine($" {activityLink.Context.TraceId} {activityLink.Context.SpanId}"); + } + } + var resource = this.ParentProvider.GetResource(); if (resource != Resource.Empty) {