最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is it possible to add custom label to feign-micrometer? - Stack Overflow

programmeradmin0浏览0评论

I have many interfaces with @FeignClient annotations, and I provide name, url and config class parameters inside annotation.

I got this libraries in my project:
implementation("io.github.openfeign:feign-micrometer:13.5")
implementation("io.micrometer:micrometer-registry-prometheus")
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")

I need to add custom label "name"=%name from annotation% to feign metric http_client_requests_seconds_** How can I do that? Of course, name should must match the feign client name, either take it from the annotation or somehow set it statically.

I tried to create custom bean MicrometerCapability(meterRegistry, mapOf("name" to "feign-name-example") in config class and add it for particular feign client in config param, but this led to adding this label to all metrics in my app, even not related to feign client ones (like jvm, kafka, hikaricp and others)

发布评论

评论列表(0)

  1. 暂无评论