-
Notifications
You must be signed in to change notification settings - Fork 66
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
@MetricOptions process based on condition #897
@MetricOptions process based on condition #897
Conversation
@MetricOptions
process based on condition
@MetricOptions
process based on condition
I had not, in fact I actually forgot that those existed / not thought about it. I will take a look at using that to build this out 👍 |
@graemerocher thank you for that suggestion! |
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.
Thanks could you add some documentation somewhere?
micrometer-core/src/main/java/io/micronaut/configuration/metrics/annotation/MetricOptions.java
Show resolved
Hide resolved
* @since 5.10.0 | ||
* @author Haiden Rothwell | ||
*/ | ||
public class MetricOptionsUtil { |
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 be final
and probably doesn't need to be public
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.
when not public
it is not callable from the interceptors due to differing packages
|
||
private static final Logger LOG = LoggerFactory.getLogger(MetricOptionsUtil.class); | ||
|
||
public static boolean evaluateCondition(MethodInvocationContext<?, ?> context) { |
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.
add javadoc and make not public
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.
Similar situation as the whole class being not public: if public is removed it is unable to be called where it currently is
micrometer-core/src/main/java/io/micronaut/configuration/metrics/util/MetricOptionsUtil.java
Outdated
Show resolved
Hide resolved
micrometer-core/src/main/java/io/micronaut/configuration/metrics/annotation/MetricOptions.java
Outdated
Show resolved
Hide resolved
could you document |
Thanks for the contribution! |
Opened in relation to #896
Opening as draft initially for asking a few questions.No longer draft as of Dec 3rd 2024Plan + thoughts:
MetricOptions
annotation that takes in classes used to filterRequires
annotation, but I was unsure if it was possible to retrieve this in these metric interceptors as things currently are. Is there a way to retrieve a ConditionContext while in these interceptors?Condition
impls were being initialized / used), but if needing access to the environment (Beans, active environments, etc) these may need to follow the pattern thatAbstractMethodTagger
does right now where it is a bean, injected into the metric interceptors, filtered, etc. Is there a way to fetch any context related information without defining a Bean or anything of the sort?TimedInterceptor
andCountedInterceptor
TimedInterceptor
prior to opening due to potential for things to change based on feedback.Edit December 3rd 2024:
MetricOptionsUtil
to share means of fetching the condition betweenCountedInterceptor
andTimedInterceptor