Because prometheus-net.AspNetCore uses the .Map method on IApplicationBuilder or IEndpointRouteBuilder, this creates a branch pipeline for the /metrics endpoint.
I can only assume the reasoning behind this and, if I'm correct in my thinking, I think it's sound reasoning. However, certain APM tools, like Dynatrace's OneAgent, have issues with this. As a result, while OneAgent can get most pieces of info about a request, such as headers, it cannot get the path of the request, resulting in the path being logged as /[declared unavailable by agent].
In our environment, we just filtered out this path, but could there be an option to have prometheus-net.AspNetCore register the middleware within the main middleware pipeline? I am aware of potential issues this could cause, but being able to call MapMetrics or UseMetricServer without prometheus-net.AspNetCore creating a branch pipeline could improve monitoring for certain applications.