Questions tagged [spring-micrometer]

Micrometer is the metrics collection facility included in Spring Boot 2’s Actuator. It has also been backported to Spring Boot 1.5, 1.4, and 1.3 with the addition of another dependency.

About

Micrometer is a dimensional-first metrics collection facade whose aim is to allow you to time, count, and gauge your code with a vendor neutral API. Through classpath and configuration, you may select one or several monitoring systems to export your metrics data to. Think of it like SLF4J, but for metrics!

Links

357 questions
3
votes
2 answers

How to create a Gauge metric with tags using Java prometheus sdk?

I have a springboot Kotlin web service that uses Actuator (spring-boot-starter-actuator) and micrometer (micrometer-registry-prometheus) to expose metrics to a prometheus scraper. To monitor the size of operations in a queue I use a custom Gauge val…
3
votes
0 answers

Tracking sparse metrics with micrometer results in zeroes being published

I'm using micrometer to publish several different metrics to Datadog; among these there is the number of items processed by several different batch jobs which can be pretty sparse. Some batch jobs have different intervals, some others are triggered…
Raibaz
  • 9,280
  • 10
  • 44
  • 65
3
votes
1 answer

Actuator metrics do not include http.server.requests

I am trying to expose timing metrics to prometheus from an api implemented with spring boot 2. I've included the following dependencies. org.springframework.boot
3
votes
2 answers

Micrometer @Timed in Spring Boot REST method and Prometheus Error

I am attempting to send data to Prometheus from my Spring Boot app using Micrometer's @Timed annotation and am seeing strange behavior. I see my method's data in prometheus, but I'm also seeing it fail in some instances with the exception below. I…
Bill Pfeiffer
  • 926
  • 8
  • 20
3
votes
1 answer

GraphQL + Spring Boot: how to collect (error) metrics?

I've been working on adding monitoring metrics in our GraphQL gateway recently. We're using graphql-spring-boot starter for the gateway. After reading the following documentations, I manage to send the basic graphql.timer.query.* metrics to…
xialin
  • 7,686
  • 9
  • 35
  • 66
3
votes
1 answer

Prometheus not exporting Kafka Consumer data upon upgrade from Spring Boot 2.1.6 to 2.2.2

We upgraded Spring Boot version from 2.1.6 to 2.2.2. Some of the properties being seen in the Prometheus endpoint in 2.1.6 is not visible in…
3
votes
1 answer

Spring Boot: statistics of APIs using http.server.requests

I want to statistics API requests in my Spring Boot 2 application, Total number of requests processed Total number of requests resulted in an OK response Total number of requests resulted in a 4xx response Total number of requests resulted in a…
Vikki
  • 1,897
  • 1
  • 17
  • 24
3
votes
1 answer

How to configure spring-boot micrometer to push into elasticsearch?

I have a spring-boot 2 application, that exposes its actuator endpoints. Those values, I want to export to an existing elasticsearch instance. Therefore I used the following: pom.xml ...
tgr
  • 3,557
  • 4
  • 33
  • 63
3
votes
1 answer

Measuring execution time using Micrometer and WebFlux

I'd like to measure the length of some async calls made with WebFlux. I've been reading through various sources, as I understand the @Timed annotation is working with AspectJ and basically just starts a timer before the method call and stops it…
OCPi
  • 316
  • 1
  • 5
  • 16
3
votes
4 answers

How to include Method Parameters in @Timed annotation used on arbitrary method name

In my application, I have a use case where I have to monitor a method by the argument value it is supplied. I have to expose the metrics to Prometheus endpoint. However, the function is a common function and is used by many different classes. I am…
3
votes
1 answer

MeterRegistry Counter does not increment

I am trying to implement error - 404 metric counter where i only want to count the number of 404 requests occurring within my api. I am not seeing the count to go up even though i am trying to mock multiple 404 request to my api. Below is my metric…
3
votes
2 answers

Spring Boot doesn't pick up Micrometer Registry from the classpath (cloudwatch)

I use Spring Boot 1.5 with micrometer-spring-legacy:1.1.4 and micrometer-registry-cloudwatch:1.1.4 on the classpath. According to the docs it should pick up this registry automatically: Having a dependency on micrometer-registry-{system} in your…
Jakub Holý
  • 6,019
  • 3
  • 33
  • 33
3
votes
1 answer

Configure distribution statistic for http.server.requests in spring-boot

Is there a way to configure distribution statistic expiry and buffer length for http.server.requests metrics? I need to increase the expiry and couldn't find the proper way of doing this with spring boot actuator. Is it possible to configure these…
3
votes
2 answers

Micrometer - Common tags for specific metrics

I'm trying to figure out how to set common tags for specific metrics. NOTE: I'm using the Cloudwatch monitoring system. Here is what I have: @Bean public MeterRegistryCustomizer metricsCommonTags() { return new…
Brooks
  • 7,099
  • 6
  • 51
  • 82
3
votes
1 answer

Showing HTTP Request API latency using the Spring Boot Micrometer metrics

We use Prometheus to scrape Spring Boot 2.0.0 metrics and then persist them in InfluxDB. We then use Grafana to visualize them from InfluxDB. Our micrometer dependencies are micrometer-core micrometer-registry-prometheus I want to be able to show…