Files
baya-monorepo/server/src/Infrastructure/Baya.Infrastructure.Monitoring/Configurations/PrometheusMetricsConfigurations.cs
T
2026-07-13 22:52:57 +03:30

18 lines
656 B
C#

using Microsoft.AspNetCore.Builder;
namespace Baya.Infrastructure.Monitoring.Configurations;
public static class PrometheusMetricsConfigurations
{
/// <summary>
/// Exposes the single OpenTelemetry metrics stack for Prometheus scraping at <c>/metrics</c>
/// (refinement-phase-9, §9.1 — replaces the removed prometheus-net <c>UseMetricServer</c>/
/// <c>UseHttpMetrics</c> stack; HTTP request metrics now come from the OTel ASP.NET Core instrumentation).
/// </summary>
public static WebApplication UseMetrics(this WebApplication app)
{
app.UseOpenTelemetryPrometheusScrapingEndpoint();
return app;
}
}