MetricsConfig

data class MetricsConfig(val enabled: Boolean, val port: Int, val path: String, val standardExportsEnabled: Boolean = false, val memoryPoolsExportsEnabled: Boolean = false, val garbageCollectorExportsEnabled: Boolean = false, val threadExportsEnabled: Boolean = false, val classLoadingExportsEnabled: Boolean = false, val versionInfoExportsEnabled: Boolean = false, val host: String? = null, val bufferPoolExportsEnabled: Boolean = false, val compilationExportsEnabled: Boolean = false, val nativeMemoryExportsEnabled: Boolean = false, val filters: List<Filter> = [])

Configuration data for the Prometheus metrics service.

Controls whether metrics collection is enabled and defines the port, bind address, filters, and path for the Prometheus scrape endpoint, as well as which JVM system metric exporters are active.

The endpoint is served without authentication unless filters add it, so the metrics server binds only loopback unless host says otherwise, and binding every interface logs a WARN. A Prometheus server that scrapes from another host or container needs host set to "0.0.0.0" (or to the interface it reaches).

Every JVM system metric exporter is off unless its flag turns it on.

Constructors

Link copied to clipboard
constructor(enabled: Boolean, port: Int, path: String, standardExportsEnabled: Boolean = false, memoryPoolsExportsEnabled: Boolean = false, garbageCollectorExportsEnabled: Boolean = false, threadExportsEnabled: Boolean = false, classLoadingExportsEnabled: Boolean = false, versionInfoExportsEnabled: Boolean = false, host: String? = null, bufferPoolExportsEnabled: Boolean = false, compilationExportsEnabled: Boolean = false, nativeMemoryExportsEnabled: Boolean = false, filters: List<Filter> = [])

Properties

Link copied to clipboard

Whether buffer pool exports are enabled.

Link copied to clipboard

Whether class loading exports are enabled.

Link copied to clipboard

Whether JIT compilation exports are enabled.

Link copied to clipboard

Whether the metrics service is enabled.

Link copied to clipboard
val filters: List<Filter>

Servlet filters that every request to the metrics server passes through, in list order, before it reaches the endpoint. A filter can answer a request itself, for example with a 401, to require authentication. Empty by default.

Link copied to clipboard

Whether garbage collector exports are enabled.

Link copied to clipboard
val host: String?

The interface the metrics server binds to. The default, null, binds 127.0.0.1, so only local clients can connect; use "0.0.0.0" to accept connections on every interface. Before 6.0.0, null bound every interface.

Link copied to clipboard

Whether memory pool exports are enabled.

Link copied to clipboard

Whether native memory exports are enabled. They are only present when the JVM runs with -XX:NativeMemoryTracking=summary (or detail).

Link copied to clipboard

The URL path for the Prometheus metrics endpoint, with or without a leading slash.

Link copied to clipboard
val port: Int

The HTTP port on which the Prometheus metrics endpoint is served.

Link copied to clipboard

Whether standard JVM exports are enabled.

Link copied to clipboard

Whether thread exports are enabled.

Link copied to clipboard

Whether version info exports are enabled.