From 7d5a80486554c60308f7204ca1888d3f05d476f7 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 27 May 2025 01:27:08 +0800 Subject: [PATCH] :bug: Fix prometheus was not added --- DysonNetwork.Sphere/DysonNetwork.Sphere.csproj | 4 ++++ DysonNetwork.Sphere/Program.cs | 6 ++++++ DysonNetwork.sln.DotSettings.user | 1 + 3 files changed, 11 insertions(+) diff --git a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj index 0bccae7..b8da08a 100644 --- a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj +++ b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj @@ -50,6 +50,10 @@ + + + + diff --git a/DysonNetwork.Sphere/Program.cs b/DysonNetwork.Sphere/Program.cs index e1d3606..9854f8f 100644 --- a/DysonNetwork.Sphere/Program.cs +++ b/DysonNetwork.Sphere/Program.cs @@ -30,6 +30,8 @@ using Microsoft.OpenApi.Models; using NodaTime; using NodaTime.Serialization.SystemTextJson; using Prometheus; +using Prometheus.DotNetRuntime; +using Prometheus.SystemMetrics; using Quartz; using StackExchange.Redis; using tusdotnet; @@ -51,6 +53,10 @@ builder.WebHost.ConfigureKestrel(options => builder.Services.UseHttpClientMetrics(); builder.Services.AddHealthChecks(); +builder.Services.AddSystemMetrics(); +builder.Services.AddPrometheusEntityFrameworkMetrics(); +builder.Services.AddPrometheusAspNetCoreMetrics(); +builder.Services.AddPrometheusHttpClientMetrics(); // Add services to the container. diff --git a/DysonNetwork.sln.DotSettings.user b/DysonNetwork.sln.DotSettings.user index 0143c1d..b94e166 100644 --- a/DysonNetwork.sln.DotSettings.user +++ b/DysonNetwork.sln.DotSettings.user @@ -13,6 +13,7 @@ ForceIncluded ForceIncluded ForceIncluded + ForceIncluded ForceIncluded ForceIncluded ForceIncluded