ConsoleExporter to print Activity(Span) Links (#2849)

This commit is contained in:
Cijo Thomas 2022-02-02 15:58:39 -08:00 committed by GitHub
parent 3833a4f503
commit 5a9d564405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,7 @@
## Unreleased ## Unreleased
Fix MetricExporter to respect Console and Debug flags. Fix MetricExporter to respect Console and Debug flags.
Added `Activity.Links` support to `ConsoleActivityExporter`.
## 1.2.0-rc1 ## 1.2.0-rc1

View File

@ -73,6 +73,15 @@ namespace OpenTelemetry.Exporter
} }
} }
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(); var resource = this.ParentProvider.GetResource();
if (resource != Resource.Empty) if (resource != Resource.Empty)
{ {