diff --git a/Aaru.Server/Aaru.Server.csproj b/Aaru.Server/Aaru.Server.csproj
index ce892457..2434fb79 100644
--- a/Aaru.Server/Aaru.Server.csproj
+++ b/Aaru.Server/Aaru.Server.csproj
@@ -5,51 +5,55 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -59,7 +63,7 @@
-
+
diff --git a/Aaru.Server/Program.cs b/Aaru.Server/Program.cs
index 76a3678a..d2f9fa1c 100644
--- a/Aaru.Server/Program.cs
+++ b/Aaru.Server/Program.cs
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;
+using OpenTelemetry.Resources;
using Sentry.OpenTelemetry;
using Serilog;
using Serilog.Events;
@@ -114,7 +115,23 @@ builder.Services.AddOpenTelemetry()
.AddSentry() // <-- Configure OpenTelemetry to send trace information to Sentry
)
.WithMetrics(metricsProviderBuilder =>
- metricsProviderBuilder.AddAspNetCoreInstrumentation().AddHttpClientInstrumentation());
+ metricsProviderBuilder
+ .SetResourceBuilder(ResourceBuilder.CreateDefault()
+ .AddService(
+ serviceName: "Aaru.Server",
+ serviceVersion: typeof(Program).Assembly.GetName().Version?.ToString() ?? "unknown"))
+ .AddAspNetCoreInstrumentation()
+ .AddHttpClientInstrumentation()
+ .AddRuntimeInstrumentation()
+ .AddProcessInstrumentation()
+ .AddEventCountersInstrumentation(options =>
+ {
+ options.AddEventSources(
+ "System.Runtime",
+ "Microsoft.AspNetCore.Hosting",
+ "Microsoft-AspNetCore-Server-Kestrel");
+ })
+ .AddPrometheusExporter());
builder.WebHost.UseSentry(o =>
{
@@ -191,6 +208,8 @@ app.MapRazorComponents().AddInteractiveServerRenderMode();
app.MapAdditionalIdentityEndpoints();
app.MapControllers();
+app.UseOpenTelemetryPrometheusScrapingEndpoint();
+
using(IServiceScope scope = app.Services.CreateScope())
{
IServiceProvider services = scope.ServiceProvider;
diff --git a/Directory.Packages.props b/Directory.Packages.props
index c1d4188f..e6d2fe05 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -1,48 +1,52 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file