24 lines
675 B
C#
24 lines
675 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Musify.Infrastructure.Observability
|
|
{
|
|
public static class OpenTelemetryDependencyInjection
|
|
{
|
|
public static IServiceCollection AddInfrastructureOpenTelemetry(this IServiceCollection serviceDescriptors)
|
|
{
|
|
serviceDescriptors
|
|
.AddOpenTelemetry()
|
|
.WithTracing(tracing =>
|
|
{
|
|
tracing.AddSource("MassTransit");
|
|
} )
|
|
.WithMetrics(metrics =>
|
|
{
|
|
metrics.AddMeter("MassTransit");
|
|
} );
|
|
|
|
return serviceDescriptors;
|
|
}
|
|
}
|
|
}
|