pixel
pixel

Reputation: 26441

How to specify single endpoint to be metered in micrometer in Spring Boot?

I would like to limit metrics

http.server.requests.seconds to a single method and uri.

Currently, I can see that all URIs are being metered (eg. /actuator/health)

Is this possible?

Upvotes: 1

Views: 340

Answers (1)

pixel
pixel

Reputation: 26441

I registered MeterRegistryCustomizer bean and called meterFilter:

...
.meterFilter(MeterFilter.deny { id ->
            val uri = id.getTag("uri")
            uri != null && uri.startsWith("/actuator")
        })

Upvotes: 1

Related Questions