OT
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.5" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.5" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
|
||||||
|
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.15.0" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Musify.Application.Contracts.Infrastructure;
|
|||||||
using Musify.Infrastructure.Configuration;
|
using Musify.Infrastructure.Configuration;
|
||||||
using Musify.Infrastructure.Identity;
|
using Musify.Infrastructure.Identity;
|
||||||
using Musify.Infrastructure.Messaging;
|
using Musify.Infrastructure.Messaging;
|
||||||
|
using Musify.Infrastructure.Observability;
|
||||||
using Musify.Infrastructure.Persistence;
|
using Musify.Infrastructure.Persistence;
|
||||||
using Musify.Infrastructure.Pictures;
|
using Musify.Infrastructure.Pictures;
|
||||||
using Musify.Infrastructure.Storage;
|
using Musify.Infrastructure.Storage;
|
||||||
@@ -20,6 +21,7 @@ namespace Musify.Infrastructure
|
|||||||
.AddKeycloakService(configuration)
|
.AddKeycloakService(configuration)
|
||||||
.AddStorageHandler()
|
.AddStorageHandler()
|
||||||
.AddPictureHandler()
|
.AddPictureHandler()
|
||||||
|
.AddInfrastructureOpenTelemetry()
|
||||||
.AddMassTransitClient()
|
.AddMassTransitClient()
|
||||||
.AddScoped<IEventBus, MassTransitEventBus>()
|
.AddScoped<IEventBus, MassTransitEventBus>()
|
||||||
.AddScoped<IProcessTrackingStore, ProcessTrackingStore>();
|
.AddScoped<IProcessTrackingStore, ProcessTrackingStore>();
|
||||||
@@ -34,6 +36,7 @@ namespace Musify.Infrastructure
|
|||||||
.AddDatabase(configuration)
|
.AddDatabase(configuration)
|
||||||
.AddStorageHandler()
|
.AddStorageHandler()
|
||||||
.AddPictureHandler()
|
.AddPictureHandler()
|
||||||
|
.AddInfrastructureOpenTelemetry()
|
||||||
.AddMassTransitConsumers()
|
.AddMassTransitConsumers()
|
||||||
.AddScoped<IEventBus, MassTransitEventBus>()
|
.AddScoped<IEventBus, MassTransitEventBus>()
|
||||||
.AddScoped<IProcessTrackingStore, ProcessTrackingStore>();
|
.AddScoped<IProcessTrackingStore, ProcessTrackingStore>();
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user