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
1 answer

Micrometer sending metrics zero - Spring Boot

I'm using Spring Boot 2 + Influx + Spring AOP to collect metrics in my system. SO, i have: org.springframework.boot spring-boot-starter-aop
3
votes
2 answers

Prometheus endpoint error when using micrometer

I'm trying to setup Prometheus monitoring on Spring boot application But getting an error: Get https://example.com:8080/actuator/prometheus: EOF My Setup application.yml management: endpoints: web: exposure: include: "*" …
royB
  • 12,779
  • 15
  • 58
  • 80
2
votes
2 answers

How to decrement a micrometer counter

I can increment the micrometer counter by doing like this: meterRegistry.counter("SOME_COUNTER").increment(); But, when I do the below: meterRegistry.counter("SOME_COUNTER").increment(-1); It is not decrementing the value. How can I decrement the…
Rahul Raj
  • 3,197
  • 5
  • 35
  • 55
2
votes
1 answer

increase() function of PromQL gives different value then actual increase

Background: I have a Spring boot Kafka consumer, and I am trying to monitor it using Prometheus and Grafana. For that, I am using the Spring's inbuild MeterRegistry. The metric I am using for counting total events consumed is…
2
votes
1 answer

TraceId in not getting pushed in logs when using micrometer

I am working on a demo project to enable distributed tracing on logs. I initially started with sleuth, but later on figured out that it is being migrated to micrometer(Sleuth is not compatible with spring boot 3.x) But out of my surprise I am not…
2
votes
1 answer

Micrometer tracing does not include the trace ID in the log

I need to include traceId in the logs for the microservice application. I'm using the micrometer tracing library, but the application is not printing logs with the Trace ID. Can someone please help me to add traceid with application logs? Below is…
Summy Saurav
  • 385
  • 1
  • 3
  • 8
2
votes
1 answer

Propagating trace IDs across HTTP REST and Kinesis messaging service boundaries after migrating to Spring Boot 3.0.1/Spring Cloud 2022.0.0

I am in the middle of migrating code from Spring Boot 2.7.7/Spring Cloud 2021.0.5 to Spring Boot 3.0.1/Spring Cloud 2022.0.0. As part of this migration, I now am using io.micrometer:micrometer-tracing-bridge-otel. While I have my code functionally…
2
votes
2 answers

Micrometer Unit Test Java

I have created a Micrometer class where counters are created and incremented. How to write unit test cases for the public method and avoid registering or sending the events to micrometer. public class MicroMeter { private static final MeterRegistry…
2
votes
1 answer

http_client_requests_seconds_count missing in spring boot promethus endpoint

I am trying to enable Prometheus endpoint in my springboot project having below dependencies. SpringBoot version: org.springframework.boot spring-boot-starter-parent
2
votes
0 answers

AwsSdkMetrics.setMetricCollector(...) for AWS SDK v2

In v1 for Java, one could call AwsSdkMetrics.setMetricCollector(new MyCustomCollector()) if you wanted SDK client metrics but didn't want to use CloudWatch (we use Prometheus and Grafana). With a custom collector, we could automatically transform…
2
votes
0 answers

Timed annotation micrometer does not work

I have this code: @Timed(value = "kafka.consumed.messages") @KafkaListener... public void consume(...) But I doesn't see this metric in prometheus, but I also have a Timer, which is shown in prometheus, how can I fixe it?
2
votes
4 answers

MeterRegistry counter test case failing

I have implemented Micrometer Prometheus counter in my service by injecting MeterRegistry and incrementing the count as shown below, and I have written a test case as well, but when I am running the test case, I am…
Kokki
  • 63
  • 1
  • 8
2
votes
0 answers

List of all spring-boot metrics micrometer properties

I couldn't find list of all supported spring-boot metrics micrometer properties. Can someone share good documentation link that I can refer? I am looking for enabling additional histogram metrics for WebClient integrations.
spachip
  • 33
  • 3
2
votes
0 answers

Springboot: Micrometer @Timed base unit

does anybody known how to change the @Timed base unit from seconds to milliseconds. I searched a lot, on the web and inside source code, but with no luck! Thank you so much!
Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
2
votes
0 answers

How to create alerts using CloudWath for Spring Boot metrics?

I have a Spring Boot microservice (Spring Cloud Gateway) deployed on AWS EKS. It sends metrics to CloudWatch, but I can't figure out how to define an alert on an aggregate metric. This is a sample of the metrics: I added a custom tag ("instanceId")…