Thanks to visit codestin.com
Credit goes to github.com

Skip to content

APM tools, such as Dynatrace's OneAgent, cannot properly profile requests to /metrics due to the use of a separate middleware pipeline #505

@natereprogle

Description

@natereprogle

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].

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions