From 48124346c0b3d12d010160e429042acaa562529a Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Fri, 16 Jul 2021 20:49:46 +0300 Subject: [PATCH] Add support for Prometheus metrics on /metrics. --- Retroactiune.WebAPI/Retroactiune.WebAPI.csproj | 2 ++ Retroactiune.WebAPI/Startup.cs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Retroactiune.WebAPI/Retroactiune.WebAPI.csproj b/Retroactiune.WebAPI/Retroactiune.WebAPI.csproj index ae4f95a..9f3c7c0 100644 --- a/Retroactiune.WebAPI/Retroactiune.WebAPI.csproj +++ b/Retroactiune.WebAPI/Retroactiune.WebAPI.csproj @@ -11,6 +11,8 @@ + + diff --git a/Retroactiune.WebAPI/Startup.cs b/Retroactiune.WebAPI/Startup.cs index 61909c3..f79b6b2 100644 --- a/Retroactiune.WebAPI/Startup.cs +++ b/Retroactiune.WebAPI/Startup.cs @@ -9,6 +9,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using MongoDB.Driver; +using Prometheus; using Retroactiune.Core.Interfaces; using Retroactiune.Core.Services; using Retroactiune.Infrastructure; @@ -19,7 +20,6 @@ namespace Retroactiune public class Startup { // TODO: Support for Sentry. - // TODO: Support for Prometheus. // TODO: External auth provider. // TODO: UI? public Startup(IConfiguration configuration) @@ -68,6 +68,8 @@ namespace Retroactiune app.UseDeveloperExceptionPage(); } + app.UseMetricServer(); + app.UseSwagger(); app.UseSwaggerUI(c => {