-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
New module that collects overall information #1625
Comments
there's micrometer module that already exposes these metrics |
Hi, |
Yes, exactly @RobWin |
Maybe the new decorator could be implemented inside resilience4j-micrometer module. |
@madhava-sridhar Any update on this? :) |
@RobWin I've added a PR for that. Please check it out. |
Hi, I think I would not mix metrics and logging in a single decorator. For logging we can make use of event handlers. I've implemented an Aspect in one of my projects which combined a several metrics (Meter and Timer) into a single annotation which could be attached to any public method or class. It measured the execution rates, success/error counts and execution time of methods. I think that could be a nice addition. Unfortunately I don't have access to the code anymore. Would someone be interested to implement this as an aspect? |
Hi, IMO it should be implemented as a raw API like any other decorators. It could be an aspect in spring boot module like there is for any other decorators. The reason is that it would be nice to have a possibility to combine the new module with others using resilience4j-all. Also aspects force you to have a public method that wraps the decorated function. You don't have this limitation by using in-code API. Also not everyone uses Spring. Setting up AOP without a framework that supports it can be difficult.
Events are published while using decorators. What if someone would like to just use the logging feature, without any decorator? I'm also struggled how to implement metrics. In the PR I did it analogically to other decoratos, but in other decorators metrics are just additional feature. In the introduced module metrics are the core feature, thus maybe they shouldn't relay on event handlers. |
Any feedback here? How would you like to implement these features? |
Hi, I still like the idea, but I prefer to separate measuring metrics from logging. I once introduced a Timer decorator for Dropwizard metrics, but never migrated it to Micrometer. Maybe you are interesting in creating something comparable for Micrometer. |
Thanks for response. |
I think we could move it into a dedicated module, maybe something like resilience4j-sl4j-logging ? |
I created a draft for metrics feature. Please check it out. If it is OK for you I'll add unit tests, spring support, kotlin support etc. |
Sounds good, will add the new module after finishing the metrics feature. |
I'm wondering what order should be set for the Timer Spring aspect. Currently we have: What's your recommendation? |
Good question. I think I would vote for this. |
Yeah, I think you're right. I would also vote this option. |
I added unit tests and converted the draft to PR, as it is ready for review. Should I create a full support for Timer (like kotlin, reactive stuff, spring boot, etc.) before merging the PR or rather split the whole implementation into multiple PRs? |
Hi, splitting into multiple PRs is fine |
Can we move forward with this? |
I can merge your MR. Could you just change onNoResult to onSuccess? |
Done. |
The above is the last PR when it comes to Timer. |
Resilience4j version: newest
Java version: doesn't matter
Hi.
What do you think about adding a new module, let's say
resilience4j-status
, which will collect overall metrics (maybe more things like logs or something) for each operation it decorates?By overall metrics I mean:
counters:
timers:
The text was updated successfully, but these errors were encountered: