Skip to content

Commit 6ea675e

Browse files
author
Chris Sinjakli
committed
Make some tweaks to wording of collector README
1 parent 710579c commit 6ea675e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

examples/rack/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ Prometheus server can be used to [play around with the metrics][rate-query].
4444
The example shown in [`config.ru`](config.ru) is a trivial rack application
4545
using the default collector and exporter middlewares.
4646

47-
Modifying the labels is a subject under development (see #111) but one option is to subclass `Prometheus::Middleware::Collector` and override the methods you need. For example, if you want to [strip IDs from the path](https://github.com/prometheus/client_ruby/blob/982fe2e3c37e2940d281573c7689224152dd791f/lib/prometheus/middleware/collector.rb#L97-L101) you could override the appropriate method:
47+
Currently, the collector middleware doesn't offer any flexibility around label
48+
keys or values (see #111). If you have more sophisticated requirements, we
49+
recommend creating your own collector middleware.
50+
51+
If your requirements are minimal, one option is to subclass
52+
`Prometheus::Middleware::Collector` and override the methods you need to. For
53+
example, if you want to [change the way IDs are stripped from the
54+
path](https://github.com/prometheus/client_ruby/blob/982fe2e3c37e2940d281573c7689224152dd791f/lib/prometheus/middleware/collector.rb#L97-L101)
55+
you could override the appropriate method:
4856

4957
```Ruby
5058
require 'prometheus/middleware/collector'
@@ -60,4 +68,8 @@ module Prometheus
6068
end
6169
```
6270

63-
and in `config.ru` use your class instead.
71+
and use your class in `config.ru` instead.
72+
73+
**Note:** `Prometheus::Middleware::Collector` isn't explicitly designed to be
74+
subclassed, so the internals are liable to change at any time, including in
75+
patch releases. Overriding its methods is done at your own risk!

0 commit comments

Comments
 (0)