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

MeterTag docs suggest availability of a SpelValueExpressionResolver which is not (yet) a real API #1

Open
cmacq2 opened this issue Jul 26, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@cmacq2
Copy link

cmacq2 commented Jul 26, 2024

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.

@jonatan-ivanov
Copy link
Member

jonatan-ivanov commented Jul 30, 2024

ValueExpressionResolver is something that the framework should implement (i.e.: SpelValueExpressionResolver for Spring) or you if your framework does not so ideally you don't need to do anything. The docs of Micrometer Tracing has an example, I think we should do the same in the Micrometer docs too.

The Micrometer docs even have that class but it is not inlined in the asciidoc files, see: SpelValueExpressionResolver.

Would you be interested filing a PR and inlining the SpelValueExpressionResolver example in the Micrometer docs the same way the Micrometer Tracing docs does (I can help)?

@jonatan-ivanov jonatan-ivanov added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants