This package is an instrumentation library which instruments the AWS Message Processing Framework for .NET to collect traces about messages that are sent and received.
$ dotnet add package AWS.Messaging.Telemetry.OpenTelemetryThis package is an Instrumentation Library, which instruments the AWS Message Processing Framework for .NET to collect traces about messages that are sent and received.
Add a reference to AWS.Messaging.Telemetry.OpenTelemetry. In this example, we're going to configure OpenTelemetry on our IServiceCollection, so also add a reference to OpenTelemetry.Extensions.Hosting. This is not required if starting and stopping tracing via CreateTracerProviderBuilder.
You may also add a reference to one or more exporters to visualize your telemetry data.
dotnet add package AWS.Messaging.Telemetry.OpenTelemetry
dotnet add package OpenTelemetry.Extensions.Hosting
In the Startup class add a call to AddOpenTelemetry to configure OpenTelemetry. On the TracerProviderBuilder, call AddAWSMessagingInstrumentation to begin capturing traces for the AWS Message Processing Framework for .NET.
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddAWSMessageBus(builder =>
{
builder.AddSQSPoller("https://sqs.us-west-2.amazonaws.com/012345678910/MPF");
builder.AddMessageHandler<ChatMessageHandler, ChatMessage>("chatMessage");
});
services.AddOpenTelemetry()
.ConfigureResource(resource => resource.AddService("myApplication"))
.WithTracing(tracing => tracing
.AddAWSMessagingInstrumentation()
.AddConsoleExporter());
}
}
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.