-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
doc-updateA documentation updateA documentation update
Milestone
Description
When configuring Micrometer to use @Metertag
annotation according to the documentation micrometer dependencies missing class SpelValueExpressionResolver
even in spring-boot application.
- I propose to add some information into documentation that will describe that
SpelValueExpressionResolver
should be implemented independently atm or should be requested in spring-boot project for spring-boot applications. - In addition, I propose to create example of simple implementation in documentation that does not use
SPEL
for cases when the application does not need to calculate the values of tags throughSPEL
at all.
Rationale
According to the documentation code snippet does not work cause class SpelValueExpressionResolver
is missing.
ValueResolver valueResolver = parameter -> "Value from myCustomTagValueResolver [" + parameter + "]";
// Example of a ValueExpressionResolver that uses Spring Expression Language
ValueExpressionResolver valueExpressionResolver = new SpelValueExpressionResolver();
// Setting the handler on the aspect
timedAspect.setMeterTagAnnotationHandler(
new MeterTagAnnotationHandler(aClass -> valueResolver, aClass -> valueExpressionResolver));
Additional context
Im facing this issue with:
- spring-boot 3.5.0
- micrometer 1.15.0
After some research I found that private class exists SpelTagValueExpressionResolver for the spring-boot applications with a bit misspelling name:
- SpelTagValueExpressionResolver in the spring-boot
- SpelValueExpressionResolver in the micrometer documentation
Unfortunately, there is no bean for this class and single usage is here as part of SpanTagAnnotationHandler
. May be this class can be created as bean for Timed and Counted aspects as additional changes in spring-boot.
Metadata
Metadata
Assignees
Labels
doc-updateA documentation updateA documentation update