Skip to content
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

GH-458: Introduce MetricsRetryListener #459

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

artembilan
Copy link
Member

Fixes: #458

@szpak
Copy link
Contributor

szpak commented Aug 1, 2024

Thanks @artembilan for your effort! I've just given it a try from the functionality point of view and after defining MetricsRetryListener as a bean, it just worked:

spring_retry_seconds_max{application="x",name="process",retry_count="0",} 0.005874044
spring_retry_seconds_max{application="x",name="process",retry_count="2",} 2.28533499
spring_retry_seconds_count{application="x",name="process",retry_count="0",} 2.0
spring_retry_seconds_count{application="x",name="process",retry_count="2",} 1.0
spring_retry_seconds_sum{application="x",name="process",retry_count="0",} 0.008557336
spring_retry_seconds_sum{application="x",name="process",retry_count="2",} 2.28533499

I will think over, if we would need anything else here, but for now it provides what we need.

@szpak
Copy link
Contributor

szpak commented Aug 1, 2024

Btw, "seconds" looks strange at the first look in the context of the counter ;-).

@artembilan
Copy link
Member Author

"seconds" looks strange at the first look in the context of the counter

Because it is not a counter, but timer. So, it gathers not only a number of call, but also some time measurements for those calls.
See Micrometer docs: https://docs.micrometer.io/micrometer/reference/concepts/timers.html

…ontext` as a key

* Change `setCustomTags()` to the `@Nullable Iterable<Tag>` argument
* Use `exception = none` tag for successful executions to avoid time-series conflicts
@artembilan artembilan merged commit 9d8df3b into spring-projects:main Aug 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Built-in support for Micrometer metrics publishing
3 participants