diff --git a/src/FakeRelay.Web/Program.cs b/src/FakeRelay.Web/Program.cs index 00a83d2..5579965 100644 --- a/src/FakeRelay.Web/Program.cs +++ b/src/FakeRelay.Web/Program.cs @@ -49,9 +49,13 @@ app.MapControllerRoute( "default", "{controller=Home}/{action=Index}/{id?}"); -app.UseEndpoints(endpoints => +var useMetrics = builder.Configuration.GetValue("EXPOSE_METRICS"); +if (useMetrics == true) { - endpoints.MapMetrics(); -}); + app.UseEndpoints(endpoints => + { + endpoints.MapMetrics(); + }); +} app.Run();