-
Notifications
You must be signed in to change notification settings - Fork 1k
Support @TimedSet in TimedAspect #5916
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
Comments
Because of the presence of What you are doing in the example can be done using one annotation: @Timed(value = "test", extraTags = {"somethingHere"}, histogram = true) This way you can query
These are just duplicates so I don't understand why/how you need/use them. @Timed(value = "test")
@Timed(value = "test.active", longTask = true) But this is what Also, as a workaround, you can create an |
Hi Jonatan, I'm working with Jacques. Our use case is to be able to provide:
The idea being to avoid generating the 70+ buckets for every value of the high cardinality tags we want to use. |
I'm still not sure I understand what you are doing:
We might have a different definition of high cardinality, can you give me an example of what you are trying to do? The example in Jacques' description, that's not really high cardinality. @Timed(value = "test", extraTags = {"operation", "one"}, histogram = true)
@GetMapping("/one")
String one() {
return "one";
}
@Timed(value = "test", extraTags = {"operation", "two"}, histogram = true)
@GetMapping("/two")
String two() {
return "two";
}
@Timed(value = "test", extraTags = {"operation", "three"}, histogram = true)
@GetMapping("/three")
String three() {
return "three";
} This ends up in 3*69 (N*69) time series for the histogram buckets (+ 9 (N*3) for count/sum/max). So you want something like this instead? @Timed(value = "test.fine", histogram = true)
@Timed(value = "test.coarse", extraTags = {"operation", "one"})
@GetMapping("/one")
String one() {
return "one";
}
@Timed(value = "test.fine", histogram = true)
@Timed(value = "test.coarse", extraTags = {"operation", "two"})
@GetMapping("/two")
String two() {
return "two";
}
@Timed(value = "test.fine", histogram = true)
@Timed(value = "test.coarse", extraTags = {"operation", "three"})
@GetMapping("/three")
String three() {
return "three";
} This ends up in 69 (1*69) time series for the histogram buckets (+ 12 (1*3+N*3) for count/sum/max). If so, this is not really high cardinality but I understand the cost-cutting part. If not, please give me an example (with annotated methods and/or time-series output). |
We add a tag depending of one of the parameter on the path of the request (something like We knew it wasn't a long term solution as the cardinality was always going to explode. We could go from 10 customer to 100 in a few months (if we're successful hehehe) and the N in your formula is suddenly a lot higher. We are looking at another solution at the moment, because making this works looks like as much (if not more) effort than migrating to a more sustainable way of collecting those metrics. Thanks a lot for your time and your support, you can close this for us if you think this is not a legitimate use case. |
I don't really understand how do you do that, do you configure a
That sounds like high cardinality which you should not do, please see the link in my previous message why: https://develotters.com/posts/high-cardinality/
I don't think your use-case is valid for this particular change but let's keep this open since there might be other users with a different use-case (e.g.: see the
Does any of this help? |
That's exactly what we do. Thanks for the warning, another sign we need to refactor this part of our service.
Yes greatly, we understand a lot more how this is suppose to be used. We'll probably play with |
Please describe the feature request.
Multiple
@Timed
annotations should be supported byTimedAspect
. This is to support custom scenarios where you'd want a dedicated metric for the histogram, or some secondary metric with alternate tags. For example :Rationale
The
@Timed
annotation is marked as@Repeatable
with@TimedSet
, but the providedTimedAspect
by the library does not provide a pointcut for it, making it unususable. Moreoever, if your class has 2 or more@Timed
annotations, it will silently get ignored.Additional context
It was asked in the past here : #1032
And it could be seen as a regression from Spring Boot 2.7 where it was handled : spring-projects/spring-boot#44236
Thanks!
The text was updated successfully, but these errors were encountered: