@Observed by jonatan-ivanov · Pull Request #3221 · micrometer-metrics/micrometer (original) (raw)
Why aren't we allowing to set highCardinalityKeyValues ?
Because attribute values of annotations must be constants, you can't have dynamic values since you can't even call a method there, only literals and constants are allowed.
Does it make any sense?
It makes sense to me. I did write a PoC and also proposed a PR for a pretty similar feature for @Timed years ago 😄, see #1586
Check out the issue (there is also a PR), the PoC tries to do two things:
- Add an
@ExtraTagannotation which is like@SpanTagin Sleuth and somewhat can cover theObject[]/Method/JointPontscenario that you mentioned above. - An
ExtraTagsPropagationclass which is similar to Sleuth 2'sExtraFieldPropagation.
I think if we want to do something like this (I think it would be a nice feature) we should keep @Timed and @Observed in feature parity to a degree.
Also, I think we should discuss about two things in terms of @Observed:
- Setting keyvalues based on the jointpoint/method/params (an extra annotation can cover that, see above)
- Setting keyvalues based on the context
Can we move this to a separate issue/PR?