Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove framework-specific route detection from collector middleware #251

Merged
merged 2 commits into from
Mar 24, 2022

Commits on Mar 9, 2022

  1. Remove framework-specific route detection from collector middleware

    Sadly, with the benefit of hindsight, this wasn't a good idea.
    
    There are two reasons we're dropping this:
    
      - It doesn't play nicely with libraries like `Rack::Builder`, which
        dispatches requests to different Rack apps based on a path prefix in
        a way that isn't visible to middleware.
    
        For example, when using `Rack::Builder`, `sinatra.route` only
        contains the parts of the path after the prefix that `Rack::Builder`
        used to dispatch to the specific app, and doesn't leave any
        information in the request environment to indicate which prefix it
        dispatched to.
      - It turns out framework-specific route info isn't always formatted in
        a way that looks good in a Prometheus label.
    
        For example, when using regex-based route-matching in Sinatra, you
        can end up with labels that look like `\\/vapes\\/([0-9]+)\\/?`.
    
    For a really detailed dive into those two issues, see this GitHub
    comment:
    
    #249 (comment)
    
    Signed-off-by: Chris Sinjakli <chris@sinjakli.co.uk>
    Sinjo committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    e0dd0f9 View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2022

  1. Document how to override path label generation in collector

    Signed-off-by: Chris Sinjakli <chris@sinjakli.co.uk>
    Sinjo committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    1dfc1ad View commit details
    Browse the repository at this point in the history