The reference documentation for @MeterTag at https://docs.micrometer.io/micrometer/reference/concepts/timers.html#_metertag_on_method_parameters suggests that there could be a SpelValueExpressionResolver available to users of Micrometer. However, it looks like this is currently not the case because, while this class does indeed exist, it resides in a test package for Micrometer itself: https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/test/java/io/micrometer/core/aop/SpelValueExpressionResolver.java
As a result. it is not possible to simply copy the example code and fix up imports, because the class is not available.
Depending on your perspective either the documentation could use some clarification that this is merely a "hypothetical" example, in which case embedding the actual SpelValueExpressionResolver implementation somewhere might make sense as an additional convenience for users, or the SpelValueExpressionResolver class should be published somewhere as part of the suite of Micrometer libraries/APIs.
Either way, right now the documentation is a little confusing (suggestive) on this point and might get the hopes up of users that were looking for a convenient feature like a SpelValueExpressionResolver to use with their own @MeterTag annotations.
The reference documentation for
@MeterTagat https://docs.micrometer.io/micrometer/reference/concepts/timers.html#_metertag_on_method_parameters suggests that there could be aSpelValueExpressionResolveravailable to users of Micrometer. However, it looks like this is currently not the case because, while this class does indeed exist, it resides in a test package for Micrometer itself: https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/test/java/io/micrometer/core/aop/SpelValueExpressionResolver.javaAs a result. it is not possible to simply copy the example code and fix up imports, because the class is not available.
Depending on your perspective either the documentation could use some clarification that this is merely a "hypothetical" example, in which case embedding the actual
SpelValueExpressionResolverimplementation somewhere might make sense as an additional convenience for users, or theSpelValueExpressionResolverclass should be published somewhere as part of the suite of Micrometer libraries/APIs.Either way, right now the documentation is a little confusing (suggestive) on this point and might get the hopes up of users that were looking for a convenient feature like a
SpelValueExpressionResolverto use with their own@MeterTagannotations.