Skip to content

Latest commit

 

History

History

DistributedTraceSample

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Distributed Trace Samples

This directory contains samples demonstrating telemetry integration with different distributed tracing providers for Durable Task applications.

Overview

Distributed tracing allows you to monitor and debug orchestrations across your entire application stack. These samples show how to configure various telemetry exporters.

Samples

Sample Description
OpenTelemetry Integration with OpenTelemetry for vendor-neutral distributed tracing
ApplicationInsights Integration with Azure Application Insights

OpenTelemetry Sample

The OpenTelemetry sample demonstrates how to configure distributed tracing with multiple exporters including Console, Application Insights, and Zipkin.

using var tracerProvider = Sdk.CreateTracerProviderBuilder()
    .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("MySample"))
    .AddSource("DurableTask.Core")
    .AddConsoleExporter()
    .AddZipkinExporter()
    .AddAzureMonitorTraceExporter(options =>
    {
        options.ConnectionString = Environment.GetEnvironmentVariable("AZURE_MONITOR_CONNECTION_STRING");
    })
    .Build();

See the OpenTelemetry README for detailed setup instructions.

Application Insights Sample

The Application Insights sample demonstrates direct integration with Azure Application Insights without OpenTelemetry.

services.AddApplicationInsightsTelemetryWorkerService();
services.TryAddEnumerable(
    ServiceDescriptor.Singleton<ITelemetryModule, DurableTelemetryModule>());

Prerequisites

  • .NET 6.0 SDK or later
  • Azure Storage Emulator (Azurite) or Azure Storage account
  • (Optional) Application Insights resource
  • (Optional) Zipkin instance for OpenTelemetry sample

Additional Resources