grpc-spring icon indicating copy to clipboard operation
grpc-spring copied to clipboard

Customizable Tags Provider

Open pluttrell opened this issue 3 years ago • 3 comments

The current implementation provides a way to add new tags or to replace the entire interceptor bean to customize metrics. The former is a great way to add new static tags and the later is a bit of a full scale replacement.

Please consider adding a middle option that would enable a way to more easily provide all of the tags.

WebFlux provides this with a WebFluxTagsProvider, which allows for full customization, including adding, renaming and omitting.

Also, it would be great if this provider passes the MethodDescriptor.

pluttrell avatar Jun 14 '22 06:06 pluttrell

Please also report/request that feature there as we will eventually switch to that one. This sound like a useful extension to me, so please ping me from the new issue and I might be able to add/implement it (when I have time). https://github.com/micrometer-metrics/micrometer/tree/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/grpc

ST-DDT avatar Jun 14 '22 07:06 ST-DDT

A Micrometer PR has been added to enable customization of the classes in Micrometer itself.

I'm hoping that whatever types are added there can be exposed as beans or customizers in this starter.

Also is there by chance a target for when this starter will switch to the Micrometer types?

pluttrell avatar Jun 15 '22 07:06 pluttrell

Also is there by chance a target for when this starter will switch to the Micrometer types?

Probably in the next release of this library.

ST-DDT avatar Jun 15 '22 08:06 ST-DDT

As for the original request in this issue (customizable tags): this could also achieved using the following code:

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.metrics.customizing

@Bean
public MeterFilter renameRegionTagMeterFilter() {
        return MeterFilter.renameTag("com.example", "mytag.region", "mytag.area");
}

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.metrics.customizing

In combination with the switch to the micrometer implementation I consider this as won't implement.

ST-DDT avatar Aug 23 '22 09:08 ST-DDT