Skip to content

Commit 3fbe6bd

Browse files
Merge branch '1.13.x' into 1.14.x
2 parents 93452c1 + 557b611 commit 3fbe6bd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -193,26 +193,25 @@ image::implementations/prometheus-long-task-timer.png[Grafana-rendered Prometheu
193193
== Limitation on same name with different set of tag keys
194194

195195
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.
196-
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:
196+
Otherwise, subsequent meters having the same name with a different set of tag keys will not be registered silently by default.
197+
This means that you should not do things like:
198+
197199
[source,java]
198200
----
199201
// Please don't do this
200202
registry.counter("test", "first", "1").increment();
201203
registry.counter("test", "second", "2").increment();
202204
----
203-
This will result in the following warning and the second `Meter` will not be registered:
204-
[source]
205-
----
206-
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.
207-
----
205+
208206
Instead you can do something like this:
207+
209208
[source,java]
210209
----
211210
registry.counter("test", "first", "1", "second", "none").increment();
212211
registry.counter("test", "first", "none", "second", "2").increment();
213212
----
214213

215-
You can change the default warning behavior by registering a meter registration failed listener.
214+
You can change the default behavior by registering a meter registration failed listener.
216215
For example, you can register a meter registration failed listener that throws an exception as follows:
217216

218217
[source,java]

0 commit comments

Comments
 (0)