Skip to content

Commit 61ea91e

Browse files
authored
Merge pull request quarkusio#47977 from brunobat/HttpServerMetricsTagsContributor
High cardinality warning on HttpServerMetricsTagsContributor.requestContextLocalData()
2 parents 4abbcf2 + 6d7aae0 commit 61ea91e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/HttpServerMetricsTagsContributor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ interface Context {
3030
* however this method is needed because {@link io.smallrye.common.vertx.ContextLocals#get(String)} won't
3131
* work when {@link HttpServerMetricsTagsContributor#contribute(Context)} is called as the HTTP request has
3232
* already gone away.
33+
* <p>
34+
* Beware of high cardinality causing memory usage increase.
35+
* <p>
36+
* Don't use keys that might hold many different values (more than a few dozens).
37+
* The problem is not just about the current request but the combination of different values from all the
38+
* requests the server will receive.
3339
*/
3440
<T> T requestContextLocalData(Object key);
3541
}

0 commit comments

Comments
 (0)