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

EndpointDescriptionUse case
/versionReturns the version of the MinIO KMS nodeVersion verification
/v1/health/liveReturns 200 OK for liveness checksKubernetes liveness probe, load balancer health
/v1/health/readyReturns 200 OK for operational readiness checksKubernetes readiness probe
/v1/health/metricsReturns Prometheus-compatible metricsPrometheus 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:

MetricTypeLabelsDescription
http_bytescounterio, apiBytes sent to and received from clients
http_requestcounterapi, statusClient API requests received
http_request_inflightgaugeapiClient API requests currently being processed
http_request_canceledcounterapiClient API requests canceled
http_request_timeoutcounterapiClient API requests that timed out
http_request_duration_secondshistogramapiTime to process client API requests
http_request_size_byteshistogramapiRequest body sizes
http_response_size_byteshistogramapiResponse 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.

MetricTypeLabelsDescription
rpc_http_bytescounterio, apiBytes sent to and received from peer nodes
rpc_http_requestcounterio, api, statusInternode requests this node sent to a peer or received from one
rpc_http_request_canceledcounterio, apiInternode requests canceled
rpc_http_request_timeoutcounterio, apiInternode requests that timed out
rpc_http_request_duration_secondshistogramio, apiInternode request time. The two io series measure different spans, described below the table
rpc_http_request_size_byteshistogramio, apiInternode request body sizes
rpc_http_response_size_byteshistogramio, apiInternode 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:

MetricTypeLabelsDescription
net_conncounterioNetwork connections established
net_conn_bytescounterioBytes sent and received over all network connections
net_conn_durationhistogramioLifetime of a network connection until it closes
net_conn_opengaugeioCurrently open network connections

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

Consensus:

MetricTypeLabelsDescription
consens_heartbeatscounterioHeartbeat rounds this node sent as leader. A follower records none, so the only series is io="send"
consens_electionscounterstatusLeadership elections this node started, by result
consens_leader_stepdowncounternoneTimes this node stepped down from the leader role

TLS:

MetricTypeLabelsDescription
tls_cert_expiry_secondsgaugenoneExpiry 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:

MetricTypeLabelsDescription
runtimeinfoversion, os, arch, compilerGo runtime version, operating system, CPU architecture, and compiler toolchain
runtime_cpu_time_secondsgaugenoneEstimated total CPU time available to user code and the runtime
runtime_cpu_time_user_secondsgaugenoneEstimated CPU time spent running user code
runtime_cpu_time_idle_secondsgaugenoneEstimated available CPU time that neither user code nor the runtime used
runtime_gc_time_secondsgaugenoneEstimated CPU time spent on garbage collection
runtime_gc_time_pause_secondsgaugenoneEstimated CPU time during which the garbage collector paused application code
runtime_gc_cyclesgaugenoneCompleted garbage collection cycles
runtime_mem_bytesgaugenoneMemory the runtime mapped into the process as read-write
runtime_mem_heap_bytesgaugenoneMemory the runtime occupies for heap objects, including reserved and not yet freed space
runtime_mem_heap_objectsgaugenoneObjects, live or unswept, occupying heap memory
runtime_mem_stack_bytesgaugenoneMemory allocated on application and runtime OS thread stacks
runtime_threadsgaugenoneOS threads that can run user-level code at the same time
runtime_goroutinesgaugenoneGoroutines running user-level code at the same time
runtime_goroutines_block_secondsgaugenoneCumulative time goroutines spent blocked on a lock

Label values

LabelValues
ioFor 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.
apiThe API endpoint the metric belongs to, such as /v1/kms or /v1/rpc/replicate.
statusFor 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 watchSeries or expressionAlert condition
Certificate expiry(tls_cert_expiry_seconds - time()) / 86400Fewer than seven days of validity remain
API errorshttp_request_timeout_total or http_request_canceled_total increasingClients unable to complete requests
Internode healthrpc_http_request_timeout_total increasingCluster communication issues
Leader stabilityconsens_elections_total increasing rapidlyFrequent leader elections indicate instability
Resource pressureruntime_goroutines growing unboundedPossible goroutine leak
Memoryruntime_mem_heap_bytes approaching system limitsMemory pressure

On this page