diff --git a/Bookings.Payments/Bookings.Payments.csproj b/Bookings.Payments/Bookings.Payments.csproj
index 2752973..e9ca47f 100644
--- a/Bookings.Payments/Bookings.Payments.csproj
+++ b/Bookings.Payments/Bookings.Payments.csproj
@@ -8,11 +8,11 @@
-
+
-
-
+
+
diff --git a/Bookings.Payments/Program.cs b/Bookings.Payments/Program.cs
index 8e9363d..d7a9ff2 100644
--- a/Bookings.Payments/Program.cs
+++ b/Bookings.Payments/Program.cs
@@ -14,7 +14,7 @@
builder.Services.AddSwaggerGen();
// OpenTelemetry instrumentation must be added before adding Eventuous services
-builder.Services.AddOpenTelemetry();
+builder.Services.AddTelemetry();
builder.Services.AddServices(builder.Configuration);
builder.Host.UseSerilog();
diff --git a/Bookings.Payments/Registrations.cs b/Bookings.Payments/Registrations.cs
index 2319634..4469428 100644
--- a/Bookings.Payments/Registrations.cs
+++ b/Bookings.Payments/Registrations.cs
@@ -30,23 +30,25 @@ public static void AddServices(this IServiceCollection services, IConfiguration
);
}
- public static void AddOpenTelemetry(this IServiceCollection services) {
- services.AddOpenTelemetryMetrics(
- builder => builder
- .AddAspNetCoreInstrumentation()
- .AddEventuous()
- .AddEventuousSubscriptions()
- .AddPrometheusExporter()
- );
+ public static void AddTelemetry(this IServiceCollection services) {
+ services.AddOpenTelemetry()
+ .WithMetrics(
+ builder => builder
+ .AddAspNetCoreInstrumentation()
+ .AddEventuous()
+ .AddEventuousSubscriptions()
+ .AddPrometheusExporter()
+ );
- services.AddOpenTelemetryTracing(
- builder => builder
- .AddAspNetCoreInstrumentation()
- .AddGrpcClientInstrumentation()
- .AddEventuousTracing()
- .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("payments"))
- .SetSampler(new AlwaysOnSampler())
- .AddZipkinExporter()
- );
+ services.AddOpenTelemetry()
+ .WithTracing(
+ builder => builder
+ .AddAspNetCoreInstrumentation()
+ .AddGrpcClientInstrumentation()
+ .AddEventuousTracing()
+ .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("payments"))
+ .SetSampler(new AlwaysOnSampler())
+ .AddZipkinExporter()
+ );
}
}
diff --git a/Bookings/Bookings.csproj b/Bookings/Bookings.csproj
index 2830b65..34675f1 100644
--- a/Bookings/Bookings.csproj
+++ b/Bookings/Bookings.csproj
@@ -12,15 +12,15 @@
-
-
-
-
-
+
+
+
+
+
-
-
+
+
diff --git a/Bookings/Program.cs b/Bookings/Program.cs
index 9afd957..b4907bd 100644
--- a/Bookings/Program.cs
+++ b/Bookings/Program.cs
@@ -31,7 +31,7 @@
.AddJsonOptions(cfg => cfg.JsonSerializerOptions.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb));
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
-builder.Services.AddOpenTelemetry();
+builder.Services.AddTelemetry();
builder.Services.AddEventuous(builder.Configuration);
builder.Services.AddEventuousSpyglass();
diff --git a/Bookings/Registrations.cs b/Bookings/Registrations.cs
index e96d363..083beea 100644
--- a/Bookings/Registrations.cs
+++ b/Bookings/Registrations.cs
@@ -59,36 +59,38 @@ public static void AddEventuous(this IServiceCollection services, IConfiguration
);
}
- public static void AddOpenTelemetry(this IServiceCollection services) {
+ public static void AddTelemetry(this IServiceCollection services) {
var otelEnabled = Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT") != null;
- services.AddOpenTelemetryMetrics(
- builder => {
- builder
- .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("bookings"))
- .AddAspNetCoreInstrumentation()
- .AddEventuous()
- .AddEventuousSubscriptions()
- .AddPrometheusExporter();
- if (otelEnabled) builder.AddOtlpExporter();
- }
- );
+ services.AddOpenTelemetry()
+ .WithMetrics(
+ builder => {
+ builder
+ .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("bookings"))
+ .AddAspNetCoreInstrumentation()
+ .AddEventuous()
+ .AddEventuousSubscriptions()
+ .AddPrometheusExporter();
+ if (otelEnabled) builder.AddOtlpExporter();
+ }
+ );
- services.AddOpenTelemetryTracing(
- builder => {
- builder
- .AddAspNetCoreInstrumentation()
- .AddGrpcClientInstrumentation()
- .AddEventuousTracing()
- .AddMongoDBInstrumentation()
- .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("bookings"))
- .SetSampler(new AlwaysOnSampler());
+ services.AddOpenTelemetry()
+ .WithTracing(
+ builder => {
+ builder
+ .AddAspNetCoreInstrumentation()
+ .AddGrpcClientInstrumentation()
+ .AddEventuousTracing()
+ .AddMongoDBInstrumentation()
+ .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("bookings"))
+ .SetSampler(new AlwaysOnSampler());
- if (otelEnabled)
- builder.AddOtlpExporter();
- else
- builder.AddZipkinExporter();
- }
- );
+ if (otelEnabled)
+ builder.AddOtlpExporter();
+ else
+ builder.AddZipkinExporter();
+ }
+ );
}
}
diff --git a/Directory.Build.props b/Directory.Build.props
index cb6751f..59a954e 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -3,6 +3,6 @@
net7.0
enable
enable
- 0.13.4-alpha.0.1
+ 0.14.1-alpha.0.7
\ No newline at end of file