New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggregate Micrometer "uri" label values under uri template #1493
Aggregate Micrometer "uri" label values under uri template #1493
Conversation
…abels * e.g. "/get/{id}" rather than "/get/123" * this provides better aggregation, protecting the time series database
Might be of interest for @velo and @tommyk-gears 😊 |
} | ||
|
||
@Test | ||
public void clientMetricsHaveUriLabel() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this tests to the AbstractMetricsTestBase
, likely this will fail for dropwizard-metrics
which would need to be made consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see - I originally placed it in AbstractMetricsTestBase
, however I realised that dropwizard-metrics
don't attach uri
and thought that was a design decision. If necessary I can add uri
on dropwizard 4 and 5 - is that what we would like? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved the tests in AbstractMetricsTestBase
and made dropwizard-metrics
4 & 5 consistent :)
Overview
Use path expression rather than explicit value for Micrometer
uri
labelsThis new default means that the value of the
uri
metric label becomes/get/{id}
rather than/get/123
uri
labelMotivation
This change provides better aggregation, protecting time series databases such as Prometheus from a large influx of time series (high-cardinality metrics).
Currently - as noted in #1481 - enabling feign client metrics from config on clients with a parametrized urls creates a scenario where a new time series is produced for each value of the provided parameter. This provides extremely high-cardinality metrics at a fast rate endangering the underlying time series database. (Resolves #1481, related to #873)
When traffic is significant, collecting client metrics with an uri expression such as
reservation/{reservationId}
can generate tens of thousands of time series (one for each value of the label, a potentially infinite set), putting Prometheus at risk. Enabling OOTB metrics without being aware of the high cardinality of some metrics is quite easy to do, so we thought we could protect some users by changing the default behaviorTesting
Questions
Thank you for your time! 😊