Skip to content

Commit

Permalink
README.md: Make path normalization more verbose.
Browse files Browse the repository at this point in the history
  • Loading branch information
RichiH committed May 15, 2017
1 parent bce9cd9 commit c1f03ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/rack/README.md
Expand Up @@ -54,7 +54,8 @@ use Prometheus::Middleware::Collector, counter_label_builder: ->(env, code) {
method: env['REQUEST_METHOD'].downcase,
# Include the HTTP Host header as label.
host: env['HTTP_HOST'].to_s,
# Replace numeric IDs in paths like /users/1234/comments with ':id'.
# Include path, but replace all numeric IDs to keep cardinality low.
# Think '/users/1234/comments' -> '/users/:id/comments'
path: env['PATH_INFO'].to_s.gsub(/\/\d+(\/|$)/, '/:id\\1'),
}
}
Expand Down

0 comments on commit c1f03ea

Please sign in to comment.