While you can use the vanilla OpenTelemetry capabilties to instrument your AWS Lambda functions for .NET as described within this tutorial, we recommend to follow our up-leveled version to
trace AWS Lambda .NET functions, which heavily reduces instrumentation effort and gives deeper and better insights into your function invocations.
In Feb 2021, AWS announced Support for AWS Distro for OpenTelemetry .NET Tracing. For general information about AWS Distro for OpenTelemetry, see the AWS Distro for OpenTelemetry page.
For tracing AWS Lambda for other languages such as Java, Node.JS, and Python using the Dynatrace AWS Lambda Layer, see Deploy OneAgent as Lambda extension.
The following prerequisites and limitations apply:
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.
Dynatrace uses OpenTelemetry trace ingest to provide end-to-end visibility to your AWS Lambda .NET Core functions.
To instrument your AWS Lambda .NET Core functions
Add the following dependencies via NuGet to your project:
OpenTelemetry.Exporter.OpenTelemetryProtocol
If you are using the AWS SDK to interact with other AWS services, you can add auto-instrumentation using the ADOT SDK for .NET
OpenTelemetry.Contrib.Instrumentation.AWS
OpenTelemetry also provides other auto-instrumentation libraries available as NuGet packages