Set method parameters as a high / low cardinality key with Observed annotation #4030
Open
Description
Please describe the feature request.
If you use @Observed
there is no easy way to set up method parameters as high or low cardinality keys. You need to get Observation
where you can set up it (for example by ObservationRegistry#getCurrentObservation()
). It would be nice to add support for marking parameters as high or low cardinality keys. I would propose creating a new annotation @CardinalityKey
which can be used to mark a parameter as a cardinality key (for example for HTTP requests it can create high and low cardinality keys). This annotation can be easily processed in the ObservedAspect
.
@Observed(name = "something")
public void send(@CardinalityKey(name = "destination") String destinationName, Object message) {
// ...
}
Rationale
I need to distinguish different calls of methods by parameters.