18 lines
656 B
C#
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;
|
|
}
|
|
}
|