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

Using Spring SPEL in the @Observed annotation to allow dynamic low and high cardinality values #4919

Closed
mloayzagahona opened this issue Apr 2, 2024 · 3 comments

Comments

@mloayzagahona
Copy link

mloayzagahona commented Apr 2, 2024

Please describe the feature request.
Using Spring SPEL in the @Observation annotation to allow dynamic low and high cardinality values

Rationale
Use Spel expression in the @Observed annotation to allow dynamic values for the low cardinality

@Observed(
      name = "observed-feature",
      contextualName = "context-one",
      lowCardinalityKeyValues = {"action", **"#method1"**})
public ResponseEntity<Object> doPost(String method1, HttpHeaders header)

Additional context
When using low cardinality in the observation, it adds to the metric as tag, and I'm looking to add tags dynamically to the underlying created metric for this observation.

@shakuzen shakuzen changed the title Using Spring SPEL in the @Observation annotation to allow dynamic low and high cardinality values Using Spring SPEL in the @Observed annotation to allow dynamic low and high cardinality values Apr 18, 2024
@shakuzen
Copy link
Member

Micrometer does not depend on Spring and we cannot (it would create a circular dependency because Spring in turn depends on Micrometer). For that reason, we cannot directly support Spring Expression Language. We do however have @MeterTag which can be configured to use a ValueExpressionResolver implementation that understands SpEL. That won't currently work with the @Observed annotation, though. I thought we had another issue for that, but I couldn't find one when searching now. We can change this issue to be an enhancement request for that, however, if it sounds like it would allow what you want.

@shakuzen shakuzen added waiting for feedback We need additional information before we can continue and removed waiting-for-triage labels Apr 18, 2024
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Copy link

github-actions bot commented May 3, 2024

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
@jonatan-ivanov jonatan-ivanov removed waiting for feedback We need additional information before we can continue feedback-reminder labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants