MicrometerMetrics

class MicrometerMetrics

Enables Micrometer support when installed. Exposes the following metrics:

  • ktor.http.server.requests.active: Gauge - The amount of active ktor requests
  • ktor.http.server.requests: Timer - Timer for all requests. By default no percentiles or histogram is exposed. Use the [Configuration.distributionStatisticConfig] to enable these. Tags by default (use [Configuration.tags] to configure the tags or add custom tags):
    • address: The host and port of the request uri (e.g. 'www.ktor.io:443' from the uri 'https://www.ktor.io/foo/bar' )
    • method: The http method (e.g. 'GET')
    • route: The use ktor route used for this request. (e.g. '/some/path/{someParameter}')
    • status: The http status code that was set in the response) (or 404 if no handler was found for this request or 500 if an exception was thrown
    • throwable: The class name of the throwable that was eventually thrown while processing the request (or 'n/a' if no throwable had been thrown). Please note, that if an exception is thrown after calling [io.ktor.response.ApplicationResponseFunctionsKt.respond(io.ktor.application.ApplicationCall, java.lang.Object, kotlin.coroutines.Continuation)] , the tag is still "n/a"

    Constructors

    Link copied to clipboard
    fun MicrometerMetrics(registry: MeterRegistry, timerDistributionConfig: DistributionStatisticConfig, timerBuilder: Timer.Builder.(call: ApplicationCall, throwable: Throwable?) -> Unit)

    Types

    Link copied to clipboard
    class Configuration

    Configures this Feature

    Link copied to clipboard

    Micrometer feature installation object