filter

fun filter(predicate: (ApplicationCall) -> Boolean)(source)

Adds a filter to exclude certain calls from metrics collection. When filters are configured, a call must match at least one filter to be recorded. If no filters are configured, all calls are recorded.

Example:

install(MicrometerMetrics) {
registry = prometheusMeterRegistry
filter { call -> call.request.uri !in setOf("/health", "/metrics") }
}

Report a problem