From 1b4a0565c2ccf3ac761d44c46314ea1fc4e29f32 Mon Sep 17 00:00:00 2001 From: Shouichi Kamiya Date: Wed, 16 Oct 2019 11:09:13 +0900 Subject: [PATCH 1/2] Remove outdated doc from collector middleware Also describe `:metrics_prefix` option. Signed-off-by: Shouichi Kamiya --- lib/prometheus/middleware/collector.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/prometheus/middleware/collector.rb b/lib/prometheus/middleware/collector.rb index 3f6c293d..43135280 100644 --- a/lib/prometheus/middleware/collector.rb +++ b/lib/prometheus/middleware/collector.rb @@ -11,20 +11,8 @@ module Middleware # By default metrics are registered on the global registry. Set the # `:registry` option to use a custom registry. # - # By default metrics all have the prefix "http_server". Set to something - # else if you like. - # - # The request counter metric is broken down by code, method and path by - # default. Set the `:counter_label_builder` option to use a custom label - # builder. - # - # The request duration metric is broken down by method and path by default. - # Set the `:duration_label_builder` option to use a custom label builder. - # - # Label Builder functions will receive a Rack env and a status code, and must - # return a hash with the labels for that request. They must also accept an empty - # env, and return a hash with the correct keys. This is necessary to initialize - # the metrics with the correct set of labels. + # By default metrics all have the prefix "http_server". Set + # `:metrics_prefix` to something else if you like. class Collector attr_reader :app, :registry From f4b773aeab089b847fd2c56925b6176e70c7f40c Mon Sep 17 00:00:00 2001 From: Shouichi Kamiya Date: Wed, 23 Oct 2019 20:15:41 +0900 Subject: [PATCH 2/2] Update lib/prometheus/middleware/collector.rb Co-Authored-By: Daniel Magliola --- lib/prometheus/middleware/collector.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/prometheus/middleware/collector.rb b/lib/prometheus/middleware/collector.rb index 43135280..65de3d17 100644 --- a/lib/prometheus/middleware/collector.rb +++ b/lib/prometheus/middleware/collector.rb @@ -13,6 +13,9 @@ module Middleware # # By default metrics all have the prefix "http_server". Set # `:metrics_prefix` to something else if you like. + # + # The request counter metric is broken down by code, method and path. + # The request duration metric is broken down by method and path. class Collector attr_reader :app, :registry