Trace Azure Functions with OpenTelemetry .NET
The OpenTelemetry Protocol (OTLP) exporters for .NET currently support gRPC and HTTP 1.1 with binary Protocol Buffers (Protobuf) payload transports. Supported corresponding protocol values are grpc
and http/protobuf
. Configuration options can be set either via environment variables or explicitly in code.
Prerequisites
The following prerequisites and limitations apply:
- Dynatrace version 1.222+
- W3C Trace Context is enabled
- Go to Settings > Preferences > OneAgent features.
- Turn on Send W3C Trace Context HTTP headers.
Instrument Azure Functions
Dynatrace uses OpenTelemetry Trace Ingest to provide end-to-end visibility to your Azure Functions.
To instrument your Azure Functions
Set up export
Add dependencies
Add the following dependencies via NuGet to your project:
OpenTelemetry.Exporter.OpenTelemetryProtocol
OpenTelemetry also provides other auto-instrumentation libraries available as NuGet packages.