Skip to content

Commit

Permalink
demonstrate SuppressInstrumentation in exporter tutorial (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang authored Aug 5, 2020
1 parent 46bb3f1 commit 67607b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/trace/building-your-own-exporter/MyExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using OpenTelemetry;
using OpenTelemetry.Trace;

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}");
Expand Down

0 comments on commit 67607b7

Please sign in to comment.