Skip to content

Commit 318faae

Browse files
authored
Polish gh-5751 (#5760)
1 parent 0ca8ca2 commit 318faae

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

docs/modules/ROOT/pages/implementations/prometheus.adoc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,26 +133,25 @@ image::implementations/prometheus-long-task-timer.png[Grafana-rendered Prometheu
133133
== Limitation on same name with different set of tag keys
134134

135135
The `PrometheusMeterRegistry` doesn't allow to create meters having the same name with a different set of tag keys, so you should guarantee that meters having the same name have the same set of tag keys.
136-
Otherwise, subsequent meters having the same name with a different set of tag keys will not be registered. This means that you should not do things like:
136+
Otherwise, subsequent meters having the same name with a different set of tag keys will not be registered silently by default.
137+
This means that you should not do things like:
138+
137139
[source,java]
138140
----
139141
// Please don't do this
140142
registry.counter("test", "first", "1").increment();
141143
registry.counter("test", "second", "2").increment();
142144
----
143-
This will result in the following warning and the second `Meter` will not be registered:
144-
[source]
145-
----
146-
WARNING: The meter (MeterId{name='test', tags=[tag(second=2)]}) registration has failed: Prometheus requires that all meters with the same name have the same set of tag keys. There is already an existing meter named 'test' containing tag keys [first]. The meter you are attempting to register has keys [second]. Note that subsequent logs will be logged at debug level.
147-
----
145+
148146
Instead you can do something like this:
147+
149148
[source,java]
150149
----
151150
registry.counter("test", "first", "1", "second", "none").increment();
152151
registry.counter("test", "first", "none", "second", "2").increment();
153152
----
154153

155-
You can change the default warning behavior by registering a meter registration failed listener.
154+
You can change the default behavior by registering a meter registration failed listener.
156155
For example, you can register a meter registration failed listener that throws an exception as follows:
157156

158157
[source,java]

0 commit comments

Comments
 (0)