demonstrate SuppressInstrumentation in exporter tutorial (#1006)

This commit is contained in:
Reiley Yang 2020-08-04 22:41:09 -07:00 committed by GitHub
parent 46bb3f1ec7
commit 67607b79f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using OpenTelemetry;
using OpenTelemetry.Trace;
internal class MyExporter : ActivityExporter
@ -26,6 +27,8 @@ internal class MyExporter : ActivityExporter
public override Task<ExportResult> ExportAsync(
IEnumerable<Activity> batch, CancellationToken cancellationToken)
{
using var scope = Sdk.SuppressInstrumentation.Begin();
foreach (var activity in batch)
{
Console.WriteLine($"{activity.DisplayName}");