Micrometer

Is it possible to define additional tags for default Spring Boot 2 metrics?

别等时光非礼了梦想. 提交于 2019-12-11 08:37:09
问题 Recently I switched to Spring Boot 2 with Micrometer . As I got these shiny new metrics, I talked with our DevOps guys and we started exporting them to Telegraf . To distinguish between different applications and application nodes, we decided to use tags. This works perfectly for custom metrics, but now I started thinking about the pre-defined. To achieve the same for default metrics, I need an ability to add extra tags for them as well. Is it possible to achieve this? Am I doing this right?

Micrometer - Prometheus Gauge displays NaN

本小妞迷上赌 提交于 2019-12-09 18:36:19
问题 I am trying to generate Prometheus metrics with using Micrometer.io with Spring Boot 2.0.0.RELEASE. When I am trying to expose the size of a List as Gauge, it keeps displaying NaN. In the documentation it says that; It is your responsibility to hold a strong reference to the state object that you are measuring with a Gauge. I have tried some different ways but I could not solve the problem. Here is my code with some trials. import io.micrometer.core.instrument.*; import io.swagger.backend

Spring Boot Actuator/Micrometer Metrics Disable Some

半腔热情 提交于 2019-12-07 13:48:10
问题 Is there a way to turn off some of the returned metric values in Actuator/Micrometer? Looking at them now I'm seeing around 1000 and would like to whittle them down to a select few say 100 to actually be sent to our registry. 回答1: Meter filters can help in 3 ways that have been discussed with the Micrometer slack channel: Disabling metrics Combining dimensions High cardinality capping filter Micrometer comes with the first type of meter filter built in. It also support hierarchical enabling

custom path for prometheus actuator

心不动则不痛 提交于 2019-12-07 04:10:15
问题 I am currently trying to migrate our prometheus lib to spring boot 2.0.3.RELEASE. We use a custom path for prometheus and so far we use a work around to ensure this. As there is the possibility for a custom path for the info- and health-endpoint, uses management.endpoint.<health/info>.path . I tried to specify management.endpoint.prometheus.path , but it was still just accessible under /actuator/prometheus . How can I use a custom path or prometheus? We enable prometheus using the following

Spring Boot Actuator 'http.server.requests' metric MAX time

半城伤御伤魂 提交于 2019-12-07 01:32:54
问题 I have a Spring Boot application and I am using Spring Boot Actuator and Micrometer in order to track metrics about my application. I am specifically concerned about the 'http.server.requests' metric and the MAX statistic: { "name": "http.server.requests", "measurements": [ { "statistic": "COUNT", "value": 2 }, { "statistic": "TOTAL_TIME", "value": 0.079653001 }, { "statistic": "MAX", "value": 0.032696019 } ], "availableTags": [ { "tag": "exception", "values": [ "None" ] }, { "tag": "method",

Spring Boot Actuator/Micrometer Metrics Disable Some

一世执手 提交于 2019-12-06 02:02:07
Is there a way to turn off some of the returned metric values in Actuator/Micrometer? Looking at them now I'm seeing around 1000 and would like to whittle them down to a select few say 100 to actually be sent to our registry. Meter filters can help in 3 ways that have been discussed with the Micrometer slack channel: Disabling metrics Combining dimensions High cardinality capping filter Micrometer comes with the first type of meter filter built in. It also support hierarchical enabling/disabling similar to how logging works (As in if have meter like my.request.total and my.request.latency you

Micrometer/Prometheus How do I keep a gauge value from becoming NaN?

╄→尐↘猪︶ㄣ 提交于 2019-12-05 16:38:56
I am trying to monitor logged in users, i am getting the logged in user info by calling api, this is the code i have used, public class MonitorService { private InfoCollectionService infoService; public MonitorService(InfoCollectionService infoService) { this.infoService = infoService } @Scheduled(fixedDelay = 5000) public void currentLoggedInUserMonitor() { infoService.getLoggedInUser("channel").forEach(channel -> { Metrics.gauge("LoggedInUsers.Inchannel_" + channel.getchannelName(), channel.getgetLoggedInUser()); }); } } And i see the values in Prometheus, the problem is after a few seconds,

custom path for prometheus actuator

人盡茶涼 提交于 2019-12-05 09:00:21
I am currently trying to migrate our prometheus lib to spring boot 2.0.3.RELEASE. We use a custom path for prometheus and so far we use a work around to ensure this. As there is the possibility for a custom path for the info- and health-endpoint, uses management.endpoint.<health/info>.path . I tried to specify management.endpoint.prometheus.path , but it was still just accessible under /actuator/prometheus . How can I use a custom path or prometheus? We enable prometheus using the following libs (snippet of our build.gradle) compile "org.springframework.boot:spring-boot-starter-actuator:2.0.3

Spring Boot 2.0 Prometheus Backward Compatibility

大兔子大兔子 提交于 2019-12-05 08:09:06
I am migrating to Spring Boot 2.0 and I am having issues with my Prometheus Metrics. I know that MicroMeter is the new way of doing stuff, which is not as crisp as the Prometheus libs but OK. My issue is that If I do not want to change my metrics now I cannot upgrade to Spring Boot 2.0. Am I right? I tried the following: Trial no 1 Keep my implementations "as is" add the new dependency io.micrometer:micrometer-registry-prometheus:1.0.2 to my app (actuator is already in there) change stuff in application.properties to get access to the endpoint actuator/prometheus => My Counters and Gauges from

Spring Boot Actuator 'http.server.requests' metric MAX time

萝らか妹 提交于 2019-12-05 05:35:10
I have a Spring Boot application and I am using Spring Boot Actuator and Micrometer in order to track metrics about my application. I am specifically concerned about the 'http.server.requests' metric and the MAX statistic: { "name": "http.server.requests", "measurements": [ { "statistic": "COUNT", "value": 2 }, { "statistic": "TOTAL_TIME", "value": 0.079653001 }, { "statistic": "MAX", "value": 0.032696019 } ], "availableTags": [ { "tag": "exception", "values": [ "None" ] }, { "tag": "method", "values": [ "GET" ] }, { "tag": "status", "values": [ "200", "400" ] } ] } I suppose the MAX statistic