742 questions
Advice
3
votes
0
replies
84
views
How can I control the shutdown order of Spring-managed beans that I don’t create myself?
I have a Spring Boot application running in Kubernetes. I’m trying to implement a graceful shutdown flow using a readiness probe:
App receives SIGTERM.
App should start returning 503 from /health so ...
0
votes
2
answers
149
views
Building and running Micrometer with Java 25
We're trying to verify that Micrometer runs on JDK 25, but when I try to build it (Mac OS, OpenJDK Runtime Environment Temurin-25.0.1+8), I get
BUG! exception in phase 'semantic analysis' in source ...
1
vote
1
answer
84
views
Thousand micrometer-kafka-metrics Threads in Spring Cloud Stream
We are running a Spring Cloud Stream (SCS) application (Spring Boot 3.5.6, SCS 4.3.0, Micrometer 1.15.4) with a Kafka Binder.
It is a fairly huge system
reading from 3 topics with 48 partitions
...
0
votes
1
answer
131
views
How to collect GC metrics for GraalVM native image in Spring Boot?
I wonder if it's possible to enable metrics for GC using GraalVM native-image in Spring Boot.
When starting the container, I get:
GC notifications will not be available because no
...
0
votes
1
answer
60
views
Spring Boot Actuator 'http.server.requests' metric MIN time
The actuator endpoint /actuator/metrics/http.server.requests can exhibit this informations:
{
"name": "http.server.requests",
"baseUnit": "seconds",
"...
3
votes
1
answer
126
views
Prometheus/Grafana: increase() spikes during Kubernetes deploys with multi-pod counters (dynamic labels)
Context
Java service in Kubernetes, multiple pods.
Metrics exposed via Micrometer + Prometheus.
Grafana dashboards use increase(...) and sum by (...) to count events in a time range.
Counters are ...
0
votes
0
answers
35
views
How to remove meters registered with MeterBinder?
I'm using an implementation of io.micrometer.core.instrument.binder.MeterBinder to bind a particular set of meters in my MeterRegistry. However, the objects that I'm metering can come and go during ...
0
votes
0
answers
132
views
Failed to send metrics to datadog: Payload too big
I'm using Micrometer 1.12.13 in a Spring Boot 3 project, with spring boot auto configured DatadogMeterRegistry to export metrics. My code looks like this:
MeterRegistry.counter("metric-name",...
0
votes
2
answers
361
views
Otel-collector not sending traces to jaeger
I have a few Java applications that have working otel tracing implementations. The details of how this works is largely irrelevant (implemented using micrometer and spring-boot-actuator) but the point ...
0
votes
1
answer
48
views
Counter type/label not getting displayed in prometheus web console [closed]
I use micrometer + spring boot + prometheus to create, register and monitor the counters from the application, apart from counters we have timer and gauge. counter created inside application which has ...
-2
votes
1
answer
448
views
How to send metrics to Prometheus using Spring Boot 3.5, Micrometer, using Pushgateway, i.e. without scraping
I have a Spring Boot application that needs to send metrics to Prometheus, but I can't use the traditional scraping approach because my application runs in an environment where Prometheus can't reach ...
0
votes
1
answer
127
views
How to add request header values as attribute to a Span?
The OTLP agent has a feature where you can add the values of request headers to a span as an attribute automatically through some configuration. How would you achieve this when using the tracing ...
1
vote
0
answers
105
views
Camel Quarkus Micrometer metrics cannot be viewed in Dynatrace
I have a Camel Quarkus application, and I can successfully view the Camel metrics at http://localhost:8080/metrics.
I’m using the Prometheus extension to expose the /metrics endpoint, and Micrometer ...
1
vote
0
answers
54
views
Most appropriate PromQL function and corresponding panel type on grafana for methods with @Timed
I am using @Timed from micrometer-core on a few methods to capture the response time of methods in a very simple way like this - @Timed(percentiles = {0.50, 0.95, 0.99, 0.999})
It is a spring-boot ...
2
votes
1
answer
1k
views
Spring Boot 3.5.0 and its support for Prometheus simpleclient
The Spring Boot 3.3 release notes mention:
Spring Boot contains auto-configuration for simpleclient in a deprecated form which will be removed in Spring Boot 3.5.0.
I would have expected the release ...
1
vote
1
answer
86
views
How can I get the start and stop times from an Observation which was run?
I have full control over an observation in my code:
Observation observation = Observation.createNotStarted("something", observationRegistry)
observation.observe(() -> doSomething(...
1
vote
1
answer
108
views
Issue with Casting `TraceContext` in `micrometer-tracing-test` Library
Description:
I am encountering an issue while working with the micrometer-tracing-test library in a Java project.
Map<String, String> baggageFromParent = ((SimpleTraceContext) context)....
0
votes
1
answer
204
views
Propagate new micrometer tracing context to Reactor Mono
Processing the message from SQS - which has initial traceId in the message and wanted to use the same traceId while processing the message, but unable to reset the traceId in the tracing context. we ...
-1
votes
1
answer
178
views
Tracing per endpoint using Spring Boot and micrometer
I have a REST API which exposes two endpoints.
Endpoint 1 is a low traffic, but mission critical. We need to trace everything from the controller layer all the way to the repository.
Endpoint 2 has ...
-1
votes
1
answer
148
views
Spotbugs + Java: EI_EXPOSE_REP2 may expose internal representation by storing an externally mutable object into MyService.observationRegistry [closed]
Small question regarding a Spotbugs finding I am having a hard time fixing.
In this super simple class:
import io.micrometer.observation.ObservationRegistry;
@Service
public final class MyService {
...
1
vote
1
answer
103
views
Observability with java spring boot actuator and micrometer annotation @Counted is ignored while @Timed works fine
Following documents and examples I try to implement @Counted and @Timed annotation based observability, basing on spring boot actuator, micrometer.
There are no build or run errors.
a method in the ...
1
vote
1
answer
93
views
Get both metrics and traces in Mongodb in Spring
I followed the Spring's documentation to see traces in Mongodb by adding the bean
@Bean
MongoClientSettingsBuilderCustomizer mongoMetricsSynchronousContextProvider(ObservationRegistry registry) {
...
0
votes
1
answer
228
views
What is the simplest way to add corellationId to logging.pattern.console?
Initially I had such logging configuration in my spring boot 3.4 app:
logging:
...
pattern:
file: "%d [%thread] %-5level %-50logger{40}- %n"
console: "%d [%thread]%-...
2
votes
2
answers
272
views
Spring boot 3.4+ webclient reactive depracated metrics filter alternative
I have spring boot 3.4+ reactive webflux app
we have been using below config to get prometheus metrics (Spring Boot 2.x)
private ExchangeFilterFunction metricsWebClientFilterFunction(String name) {...
0
votes
1
answer
68
views
How to replace ZipkinSpanExporter to my Own in spring boot application?
I have an application based on spring boot 3.4
I have application.properties with lines:
management.tracing.sampling.probability=1
management.zipkin.tracing.export.enabled=false
and dependencies:
// ...
0
votes
1
answer
58
views
How to propagate micrometer traces to Ldap server using unboundId sdk?
Based on
official spring boot documentation
Propagating Traces
To automatically propagate traces over the network, use the auto-configured RestTemplateBuilder,
RestClient.Builder or WebClient.Builder ...
0
votes
1
answer
81
views
Is there way to persist traces on a disk instead of sending them to Zipkin?
I have spring boot 3.4 application configured for metrics.
I've added dependencies:
implementation("io.micrometer:micrometer-tracing-bridge-otel")
implementation("io....
0
votes
1
answer
117
views
How to put argument values to traces of method annotated with @Observed
I have a method annotated with @Observed annotation:
@Observed(
name = "foo",
contextualName = "foo",
)
fun foo(arg1: String, arg2: Integer){...}
When I go to Zipkin I see ...
1
vote
0
answers
121
views
Spring Webflux + Micrometer: difference between .tap(Micrometer.observation(observationRegistry)) before and after the operation to measure
I would like to generate metrics (time) and traces for a reactive operation.
Here is the reactive operation, very straightforward:
@GetMapping("/question")
Flux<String> ...
0
votes
0
answers
33
views
How to set micrometer prometheus response content
I use latest quarkus-micrometer-registry-prometheus library 1.14.4 expose the default metrics. But our company service collect metrics by text/plain context. Collector send request without any header, ...
0
votes
0
answers
214
views
Spring Boot 3.4 ECS Logging and Micrometer Tracing Discrepancy
Environment
Spring Boot 3.4
ECS Structured Logging (logging.structured.format.console=ecs)
Micrometer Tracing with Brave (io.micrometer:micrometer-tracing-bridge-brave)
Issue Description
I've ...
0
votes
0
answers
217
views
Is it possible to add custom label to feign-micrometer?
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....
0
votes
1
answer
162
views
spring boot 3, with @Scheduled, and io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter keep using same trace id again and again?
Spring boot 3.4.2 with:
io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter
Managed by:
mavenBom("io.opentelemetry:opentelemetry-bom:1.46.0")
and
mavenBom("io....
1
vote
1
answer
341
views
Sending custom metrics to Elasticsearch in Spring Boot
I am integrating my Spring Boot application to Kibana and followed these steps:
JDK: 17
step-1: Adding elastic-apm-agent
added elastic-apm-agent.jar(1.51.1) into dockerfile. And I see the APM on ...
0
votes
0
answers
101
views
How to troubleshoot spring boot micrometer ingestion to dynatrace without oneagent?
I created a dynatrace 14 day trial account
I have a spring boot application
spring.application.name=dynatrace-example
management.endpoints.web.exposure.include=health, metrics
management.dynatrace....
0
votes
0
answers
121
views
Spring boot 3 with micrometer 1.4+, how to skip tracing but continue to report metrics
While upgrading to Spring boot 3.4 I'm struggling to figure out how to "only" skip tracing for certain uris/paths while continuing to report metrics.
For some endpoints like actuators and ...
1
vote
1
answer
991
views
SpringBoot cache + caffeine + micrometer, how to configure multiple caches in one application and with observability
My use case is fairly simple. I have a SpringBoot app that does nothing but expose one rest endpoint.
The rest endpoint does nothing but call two other external services I have no control over. The ...
1
vote
1
answer
333
views
Micrometer cannot send metrics of spring applications to influxdb
I'm triing to add monitoring to my Spring application. A added dependencies
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-...
1
vote
1
answer
363
views
micrometer Instrumentation of Thread Switching Components for Executors.newVirtualThreadPerTaskExecutor() with for loop
I have the following piece of code:
@PostMapping("/question")
public String question(@RequestBody List<String> messages) {
try (ExecutorService executor = Executors....
0
votes
0
answers
71
views
How to rename http metric in OTEL JS
I have many java applications and they have been instrumented with Micrometer(SpringBoot natively support it). They send metric to OTLP Mimir.
I have a NodeJS application which I want to instrument ...
0
votes
1
answer
48
views
Unable to create Timer instance when writing tests
I have the following Java code
public void histogram(final String metricType, final Tags tags, final long startTime) {
long responseTimeMillis = System.currentTimeMillis() - startTime;
...
1
vote
1
answer
141
views
Histogram metric with labels/tags
I have the following Java snippet that I am using to publish histogram metrics
public class MessageConsumer {
private MeterRegistry meterRegistry;
private NormalRandomGenerator ...
0
votes
0
answers
124
views
Problem in Distributed Tracing over WebSocket with STOMP: Transitioning from Sleuth to Micrometer, Trace IDs and Span IDs does not appear
I have been working on a project implemented using Spring Boot 2.7.8. The WebSocket protocol was chosen to handle real-time messaging, and STOMP over WebSocket is used for effective client-server ...
0
votes
0
answers
123
views
Intermittent Spring Boot micrometer failed to send metrics to elastic: premature EOF after Elastic 8.16 upgrade
I am using spring boot 3.3.6, looks like it is using micrometer-elastic-registry:1.13.6. I didn't see this errors until I upgrade Elastic from 8.11.4 to 8.16. There were no changes to anything else so ...
-1
votes
1
answer
84
views
When using Micrometer in SpringBoot, how to propagate traceId and spainId onto a file uploaded to AWS S3?
Is it possible to propagate the tracing info to a file uploaded to AWS S3, or to an SFTP?
This way, if somebody is polling from a directory, I want for him to be able to continue using the same ...
0
votes
0
answers
205
views
Correlate traces for spans sent in parallel for Springboot micrometer
I have a Springboot 3.4 web service with micrometer
The endpoint is straightforward, the controller accepts a list of messages to be sent to an external rest API I have no control over. The processing ...
0
votes
0
answers
104
views
Micrometer Observation - adding metadata to an observation
I am working with Spring Observability and Micrometer. I am trying to capture some metadata for my spans, specifically the param keys and values.
I know I can use the @Observed annotation but it looks ...
2
votes
0
answers
174
views
Propagate/continue the traces from a client sending traces via custom headers in Springboot 3.4
We have a Springboot 3.4 web service with micrometer, serving traffic for two clients.
Client one, we are lucky, is also using Springboot 3+. Like magic, Springboot is able to "propagate", &...
0
votes
1
answer
1k
views
How to publish slo/percentile distribution metrics for my micrometer timer?
The question originally came from the problem with metrics configuration for Spring Cloud Gateway, as there are no documentation neither on Micrometer nor Spring Cloud nor Spring side. When i enable ...
0
votes
1
answer
102
views
Configure Wildfly micrometer to set name of application
We are using Wildfly 33 (jboss 7.1.0) and we have configured it to use micrometer. It now sends the metrics via an Open Telemetry collector to a prometheus instance. This works great but the problem ...