Monitoring

MinIO KMS provides API endpoints for monitoring deployment health, status, and performance, as well as Prometheus-compatible metrics for integration with monitoring systems.

Health endpoints

Endpoint Description Use case
/version Returns the version of the MinIO KMS node Version verification
/v1/health/live Returns 200 OK for liveness checks Kubernetes liveness probe, load balancer health
/v1/health/ready Returns 200 OK for operational readiness checks Kubernetes readiness probe
/v1/health/metrics Returns Prometheus-compatible metrics Prometheus scraping

Prometheus metrics

The /v1/health/metrics endpoint exposes metrics in OpenMetrics v1.0 format, compatible with Prometheus text format.

Each node reports only its own activity. Counters increase until the process restarts, at which point they reset to zero. Gauges report the value at the time of the scrape.

Scrape configuration

A Prometheus scrape job for MinIO KMS needs three settings:

  • scheme: https, because MinIO KMS serves HTTPS only and has no plaintext HTTP endpoint.
  • metrics_path: /v1/health/metrics, because MinIO KMS serves metrics only at that path. Prometheus scrapes /metrics by default, and MinIO KMS does not serve that path.
  • ca_file, the CA certificate that issued the MinIO KMS server certificate, so that Prometheus can verify the server.

The metrics endpoint is unprivileged. Prometheus does not need a client certificate to scrape it, so the job needs no cert_file or key_file.

Add the following job to your Prometheus configuration:

scrape_configs:
  - job_name: minkms
    scheme: https
    metrics_path: /v1/health/metrics
    tls_config:
      ca_file: /path/to/ca.crt
    static_configs:
      - targets:
          - MINKMS_HOST_1:7373
          - MINKMS_HOST_2:7373
          - MINKMS_HOST_3:7373

Replace the targets with your MinIO KMS node addresses.

Metric names

Metric names follow the OpenMetrics conventions. A metric that has a unit carries the unit as a name suffix: durations end in _seconds and byte counts end in _bytes. The tables below list each metric family under the name MinIO KMS exposes.

A query in PromQL, the Prometheus query language, uses the time series name rather than the family name. The two names differ for three of the four metric types:

  • Counter: the series carries a _total suffix. Query the http_request family as http_request_total.
  • Histogram: each family exposes NAME_bucket series, one per bucket boundary plus +Inf, along with NAME_sum and NAME_count.
  • Info: the series carries an _info suffix. Query the runtime family as runtime_info.
  • Gauge: query the family name unchanged.

One metric departs from the unit-suffix rule. net_conn_duration records seconds but carries no _seconds suffix, so query it as net_conn_duration_bucket, net_conn_duration_sum, and net_conn_duration_count.

Available metrics

Client API:

Metric Type Labels Description
http_bytes counter io, api Bytes sent to and received from clients
http_request counter api, status Client API requests received
http_request_inflight gauge api Client API requests currently being processed
http_request_canceled counter api Client API requests canceled
http_request_timeout counter api Client API requests that timed out
http_request_duration_seconds histogram api Time to process client API requests
http_request_size_bytes histogram api Request body sizes
http_response_size_bytes histogram api Response body sizes

Duration buckets are 0.001, 0.01, 0.05, 0.1, 0.25, 0.5, 1, 3, and 10 seconds. Size buckets are 1, 256, 512, 1024, 4096, 16384, 65536, 524288, and 1048576 bytes.

Internode RPC:

These metrics cover traffic between cluster nodes. On a single-node deployment they stay at zero.

Metric Type Labels Description
rpc_http_bytes counter io, api Bytes sent to and received from peer nodes
rpc_http_request counter io, api, status Internode requests this node sent to a peer or received from one
rpc_http_request_canceled counter io, api Internode requests canceled
rpc_http_request_timeout counter io, api Internode requests that timed out
rpc_http_request_duration_seconds histogram io, api Internode request time. The two io series measure different spans, described below the table
rpc_http_request_size_bytes histogram io, api Internode request body sizes
rpc_http_response_size_bytes histogram io, api Internode response body sizes

Duration buckets are 0.001, 0.01, 0.05, 0.1, 0.25, 0.5, 1, 3, and 10 seconds. Size buckets are 1, 256, 512, 1024, 4096, 16384, 65536, and 524288 bytes.

The two io series of rpc_http_request_duration_seconds measure different spans. The io="recv" series records the time this node spends handling a request from a peer. The io="send" series records the round trip, from the moment this node sends the request until the peer’s response headers arrive, so it includes network time and the peer’s handling time.

Network connections:

Metric Type Labels Description
net_conn counter io Network connections established
net_conn_bytes counter io Bytes sent and received over all network connections
net_conn_duration histogram io Lifetime of a network connection until it closes
net_conn_open gauge io Currently open network connections

Connection lifetime buckets are 0.01, 0.1, 0.5, 1, 5, 10, 30, 60, 300, and 3600 seconds.

Consensus:

Metric Type Labels Description
consens_heartbeats counter io Heartbeat rounds this node sent as leader. A follower records none, so the only series is io="send"
consens_elections counter status Leadership elections this node started, by result
consens_leader_stepdown counter none Times this node stepped down from the leader role

TLS:

Metric Type Labels Description
tls_cert_expiry_seconds gauge none Expiry of the TLS server certificate the node currently serves, as a Unix timestamp in seconds

MinIO KMS refreshes tls_cert_expiry_seconds in the background, so the value follows a certificate rotation without a restart. Compare it against time() to get the remaining validity.

Runtime:

Metric Type Labels Description
runtime info version, os, arch, compiler Go runtime version, operating system, CPU architecture, and compiler toolchain
runtime_cpu_time_seconds gauge none Estimated total CPU time available to user code and the runtime
runtime_cpu_time_user_seconds gauge none Estimated CPU time spent running user code
runtime_cpu_time_idle_seconds gauge none Estimated available CPU time that neither user code nor the runtime used
runtime_gc_time_seconds gauge none Estimated CPU time spent on garbage collection
runtime_gc_time_pause_seconds gauge none Estimated CPU time during which the garbage collector paused application code
runtime_gc_cycles gauge none Completed garbage collection cycles
runtime_mem_bytes gauge none Memory the runtime mapped into the process as read-write
runtime_mem_heap_bytes gauge none Memory the runtime occupies for heap objects, including reserved and not yet freed space
runtime_mem_heap_objects gauge none Objects, live or unswept, occupying heap memory
runtime_mem_stack_bytes gauge none Memory allocated on application and runtime OS thread stacks
runtime_threads gauge none OS threads that can run user-level code at the same time
runtime_goroutines gauge none Goroutines running user-level code at the same time
runtime_goroutines_block_seconds gauge none Cumulative time goroutines spent blocked on a lock

Label values

Label Values
io For connection metrics, in for an accepted connection and out for an outgoing one. For byte counters, send for data the node sent and recv for data it received. For internode request metrics, send when this node sent the request and recv when it received one.
api The API endpoint the metric belongs to, such as /v1/kms or /v1/rpc/replicate.
status For HTTP and RPC metrics, the HTTP status code, such as 200, 403, or 503. An internode request that fails before a response arrives records error instead. For consens_elections, the election result, won or lost.

Key metrics to monitor

This table uses time series names, so the counters carry their _total suffix.

What to watch Series or expression Alert condition
Certificate expiry (tls_cert_expiry_seconds - time()) / 86400 Fewer than seven days of validity remain
API errors http_request_timeout_total or http_request_canceled_total increasing Clients unable to complete requests
Internode health rpc_http_request_timeout_total increasing Cluster communication issues
Leader stability consens_elections_total increasing rapidly Frequent leader elections indicate instability
Resource pressure runtime_goroutines growing unbounded Possible goroutine leak
Memory runtime_mem_heap_bytes approaching system limits Memory pressure