diff --git a/Infrastructure/Infrastructure.csproj b/Infrastructure/Infrastructure.csproj
index 3bc091b..a813415 100644
--- a/Infrastructure/Infrastructure.csproj
+++ b/Infrastructure/Infrastructure.csproj
@@ -22,6 +22,7 @@
+
diff --git a/Infrastructure/InfrastructureDependencyInjection.cs b/Infrastructure/InfrastructureDependencyInjection.cs
index 64e7474..8923781 100644
--- a/Infrastructure/InfrastructureDependencyInjection.cs
+++ b/Infrastructure/InfrastructureDependencyInjection.cs
@@ -4,6 +4,7 @@ using Musify.Application.Contracts.Infrastructure;
using Musify.Infrastructure.Configuration;
using Musify.Infrastructure.Identity;
using Musify.Infrastructure.Messaging;
+using Musify.Infrastructure.Observability;
using Musify.Infrastructure.Persistence;
using Musify.Infrastructure.Pictures;
using Musify.Infrastructure.Storage;
@@ -20,6 +21,7 @@ namespace Musify.Infrastructure
.AddKeycloakService(configuration)
.AddStorageHandler()
.AddPictureHandler()
+ .AddInfrastructureOpenTelemetry()
.AddMassTransitClient()
.AddScoped()
.AddScoped();
@@ -34,6 +36,7 @@ namespace Musify.Infrastructure
.AddDatabase(configuration)
.AddStorageHandler()
.AddPictureHandler()
+ .AddInfrastructureOpenTelemetry()
.AddMassTransitConsumers()
.AddScoped()
.AddScoped();
diff --git a/Infrastructure/Observability/OpenTelemetryDependencyInjection.cs b/Infrastructure/Observability/OpenTelemetryDependencyInjection.cs
new file mode 100644
index 0000000..4618185
--- /dev/null
+++ b/Infrastructure/Observability/OpenTelemetryDependencyInjection.cs
@@ -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;
+ }
+ }
+}