.NET on AWS Blog

Announcing the general availability of AWS .NET OpenTelemetry libraries

Observability has become a crucial aspect of modern software development, enabling developers to gain insights into the behavior and performance of their applications. The OpenTelemetry project, a Cloud Native Computing Foundation (CNCF) hosted project, has emerged as a powerful solution for generating, collecting, and exporting telemetry data, providing a vendor-neutral and standardized approach to observability.

AWS customers have been able to use OpenTelemetry in their dotnet workloads since the initial release of the OpenTelemetry.Contrib.Extensions.AWSXRay and OpenTelemetry.Contrib.Instrumentation.AWS NuGet packages in February 2021.

Today we’re excited to announce that the latest iteration of these packages have been released and are available in NuGet. The packages have been reworked for simplicity and to conform to the latest OpenTelemetry naming conventions. They include new features like support for enhanced observability in AWS SDK for .NET and additional instrumentation for AWS services, including Amazon Bedrock, as well as multiple bug fixes, enhancements and contributions by the OpenTelemetry community.

What’s new?

This release introduces new package names without the former Contrib portion. The details for these updated packages are as follows:

Installation

Add one or more of the packages above to your Project. This can be done, among other ways, via the dotnet CLIi:

dotnet add package OpenTelemetry.Instrumentation.AWS

Then, use the extensions methods, such as AddAWSInstrumentation, when building your OpenTelemetry Trace Provider or Metrics Provider:

For example, in the beginning of a Program.cs for a console application:

using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;

Sdk.CreateTracerProviderBuilder()
    .ConfigureResource(r => r.AddService("DemoOtel"))
    .AddAWSInstrumentation()
    .AddConsoleExporter()
    .Build();
C#

The AddAWSInstrumentation method seamlessly integrates OpenTelemetry tracing into your application. The AddConsoleExporter method adds a simple console exporter for your OpenTelemetry data. For a full example, read through the Enhancing Observability in the AWS SDK for .NET with OpenTelemetry blog post.

Because of the OpenTelemetry naming convention change, you must replace previous versions of the AWS OpenTelemetry extension packages:

OpenTelemetry.Contrib.Instrumentation.AWS is now OpenTelemetry.Instrumentation.AWS
OpenTelemetry.Contrib.Extensions.AWSXRay is now OpenTelemetry.Extensions.AWS

Be sure to also update any using statements that reference the old packages with the new package names. For example:

using OpenTelemetry.Instrumentation.AWS;
using OpenTelemetry.Extensions.AWS;

Conclusion

OpenTelemetry is quickly becoming the de facto standard framework for generating, collecting, and exporting your applications observability signals. These signals can then be processed and analyzed using managed AWS Observability tools that include AWS-native solutions like Amazon CloudWatch and AWS X-Ray to managed open-source solutions like Amazon Managed Grafana and Amazon Managed Service for Prometheus.

Whether you’re a seasoned .NET developer on AWS already leveraging OpenTelemetry, integrating it into your applications for the first time, or utilizing it through .NET Aspire, we’re thrilled to introduce the latest enhancements for observability into your .NET workloads running on AWS. These improvements will provide you with deeper insights, streamlined troubleshooting, and enhanced visibility into the performance and behavior of your .NET applications deployed on the AWS platform.

Try these new libraries to implement observability in your .NET applications on AWS and give us feedback by sending an issue or creating a pull request at https://github.com/open-telemetry/opentelemetry-dotnet-contrib.

We recommend the following additional readings, which cover various topics related to this blog post.

Finally, a big thank you to the OpenTelemetry community and especially the OpenTelemetry .NET Contrib Maintainers for collaborating with us and making this release possible!

Jagadeesh Chitikesi

Jagadeesh Chitikesi

Jagadeesh is a Sr. Microsoft Specialist Solutions Architect at AWS. He worked as a developer and an architect with enterprises of all sizes across healthcare, finance, retail, utility, and government for the last 20 years. He is passionate about cloud and all the innovation happening at AWS.

Philip Pittle

Philip Pittle

Philip 'pj' Pittle has been developing .NET applications since Framework 1.1. He is a Senior Software Engineer building .NET tools for AWS developers, with a focus on open source.

Ulili Nhaga

Ulili Nhaga

Ulili Nhaga is a Cloud Application Architect at Amazon Web Services in San Diego, California. He helps customers migrate, modernize, architect, and build highly scalable cloud-native applications on AWS. Outside of work, Ulili loves playing soccer, running, cycling, Brazilian BBQ, and enjoying time on the beach.