Skip to content

Commit

Permalink
Fix not checking for path...
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Nov 19, 2024
1 parent d75f533 commit 32d3834
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Common/OpenShockMiddlewareHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public static IApplicationBuilder UseCommonOpenShockMiddleware(this IApplication

app.UseOpenTelemetryPrometheusScrapingEndpoint(context =>
{
if(context.Request.Path != "/metrics") return false;

var remoteIp = context.Connection.RemoteIpAddress;
return remoteIp != null && metricsAllowedIpNetworks.Any(x => x.Contains(remoteIp));
});
Expand Down

0 comments on commit 32d3834

Please sign in to comment.