Armeria: Limit the cardinality of request metrics

Created on 3 Oct 2019  路  7Comments  路  Source: line/armeria

I heard that RestTemplate logs a warning about large cardinality of meter tags and refuses to record the metrics for the tag combinations generated after then. We could also implement something similar.

good first issue new feature

Most helpful comment

It's all yours, @SooJungDev!

All 7 comments

Related commit: https://github.com/spring-projects/spring-boot/commit/1a9c268b6baecaa44ffb770e736c40960c625cd3
Related issue: https://github.com/spring-projects/spring-boot/issues/11338
Related MeterFilter implementation in Micrometer: https://github.com/micrometer-metrics/micrometer/blob/HEAD@%7B2019-10-03T06:14:12Z%7D/micrometer-core/src/main/java/io/micrometer/core/instrument/config/MeterFilter.java#L207-L231

In Armeria, MetricCollecting{Client,Service} collects the request metrics. We could modify them to count the cardinality and enforce the limitation.

We need to:

  • Allow a user specify max cardinality when creating MetricCollecting{Client,Service}.
  • Modify MetricCollecting{Client,Service} to respect the max cardinality and warn when the cardinality is too large.
  • Add the configuration property for the max cardinality to the Spring Boot integration.

I'll work on it

It's all yours, @SooJungDev!

@SooJungDev @trustin Gentle ping 馃槈

I'm interested in this. Can I try?
Or can you recommend another issue?

yes, you can try!!@heowc thank you:wink:

@trustin

I've been analyzing the code for a few days, and I have some questions.

We could also implement something similar. (comment)

Does it mean to use Meterfilter? Or does it mean a similar implementation? It seems strange to integrate with spring boot if you mean to implement similarly.

Allow a user to specify max cardinality when creating MetricCollecting{Client,Service}. (comment)

Why should the user set max cardinality in MetricCollecting {Client, Service}? Isn't it a good idea to set it in the registry?

If I'm misunderstanding, please point me in the right path. Thank you. 馃槃

Was this page helpful?
0 / 5 - 0 ratings