Skip to content

Metrics

VAULT labels, 14 recording rules, and raw OpenBao metrics used by the monitoring dashboard.

This page distinguishes raw OpenBao telemetry from recording metrics evaluated by vmalert. files/victoria/rules/vault.yml defines 14 recording rules. Their results are not available from /v1/sys/metrics.

Raw metrics vary with OpenBao version, member role, and runtime state. The metrics below are those used by Vault Overview and its rules, not the full telemetry output. See OpenBao telemetry metrics for the complete list.


Labels

VAULT metrics use these labels:

LabelMeaningExample
jobScrape jobvault
clsCluster name, vault_clustervault
insInstance name, <vault_cluster>-<vault_seq>vault-1
ipMember address10.10.10.11
instanceScrape address10.10.10.11:8200

Recording rules use vault:ins:* for instances and vault:cls:* for clusters.


Raw Metric Behavior

OpenBao retains Vault’s vault_ prefix and exports Prometheus metrics through go-metrics. Note:

  • Counters lack a _total suffix, for example vault_raft_apply and vault_token_creation.
  • Summaries use milliseconds: quantiles and _sum for vault_core_handle_request are in milliseconds. Recording rules divide average latency by 1,000 to convert it to seconds.
  • Some counters appear only after their first event, such as vault_audit_log_request_failure. Rules use increase_pure to count increases from zero.
  • Only the leader reports Autopilot and follower metrics. They persist for 24 hours after it steps down (prometheus_retention_time). Rules use only the current active member’s values and map node_id / peer_id back to ins.
  • Usage gauges (tokens, KV secrets, identity entities) are computed every ten minutes (usage_gauge_period).

Recording Rules

Expressions preserve source semantics. ins and cls indicate instance and cluster aggregation; actual retained labels follow the by and vector-matching clauses.

Recording MetricDescriptionExpression
vault:ins:req_rpsNon-login requests per second per instancerate(vault_core_handle_request_count{job="vault"}[1m])
vault:ins:login_rpsLogin requests per second per instancerate(vault_core_handle_login_request_count{job="vault"}[1m])
vault:ins:req_rt_avg_5mFive-minute mean instance request latency, in secondsrate(vault_core_handle_request_sum{job="vault"}[5m]) / rate(vault_core_handle_request_count{job="vault"}[5m]) / 1000
vault:cls:req_rt_avg_5mFive-minute mean cluster request latency, weighted by request volume, in secondssum by (job,cls) (rate(vault_core_handle_request_sum{job="vault"}[5m])) / sum by (job,cls) (rate(vault_core_handle_request_count{job="vault"}[5m])) / 1000
vault:cls:unsealedNumber of unsealed cluster memberssum by (job,cls) (vault_core_unsealed{job="vault"}) or (0 * count by (job,cls) (up{job="vault"}))
vault:cls:activeNumber of active cluster members; normally exactly onesum by (job,cls) (vault_core_active{job="vault"}) or (0 * count by (job,cls) (up{job="vault"}))
vault:cls:autopilot_healthyCluster health as reported by the active membermax by (job,cls) (vault_autopilot_healthy{job="vault"} and on(ins) (vault_core_active{job="vault"} == 1))
vault:cls:failure_toleranceCluster fault tolerance as reported by the active membermax by (job,cls) (vault_autopilot_failure_tolerance{job="vault"} and on(ins) (vault_core_active{job="vault"} == 1))
vault:ins:autopilot_healthyMember health as reported by the active membermax by (job,cls,ins) (label_replace(vault_autopilot_node_healthy{job="vault"} and on(ins) (vault_core_active{job="vault"} == 1), "ins", "$1", "node_id", "(.+)"))
vault:ins:raft_lagNumber of log entries by which a follower’s applied index trails the leadermax by (job,cls,ins) (label_replace(vault_raft_storage_follower_applied_index_delta{job="vault"} and on(ins) (vault_core_active{job="vault"} == 1), "ins", "$1", "peer_id", "(.+)"))
vault:ins:raft_heartbeat_msMilliseconds since the follower’s last heartbeatmax by (job,cls,ins) (label_replace(vault_raft_storage_follower_last_heartbeat_ms{job="vault"} and on(ins) (vault_core_active{job="vault"} == 1), "ins", "$1", "peer_id", "(.+)"))
vault:ins:audit_failure_5mAudit write failures per instance over five minutessum by (job,cls,ins,ip,instance) (increase_pure({__name__=~"vault_audit_log_(request|response)_failure",job="vault"}[5m]))
vault:ins:backup_timeUnix timestamp of the instance’s latest successful snapshotmax by (ip) (vault_backup_last_success_timestamp_seconds) + on(ip) group_right() vault_up * 0
vault:ins:backup_sizeSize of the instance’s latest successful snapshot, in bytesmax by (ip) (vault_backup_size_bytes) + on(ip) group_right() vault_up * 0

With no requests in a time window, average latency is 0/0 = NaN, which is discarded and appears as no data.

vault_up comes from INFRA’s shared aliveness rules, based on up{job="vault"}. It is not counted among the module’s rules. It indicates scrape success, not whether a member is unsealed or serving requests.


Common Raw Metrics

State and requests

MetricTypeDescription
vault_core_unsealedGaugeWhether the member is unsealed; 1 means unsealed
vault_core_activeGaugeWhether the member is active; 1 means active
vault_core_handle_requestSummary (ms)Non-login request duration, including quantiles, _sum, and _count
vault_core_handle_login_requestSummary (ms)Login request duration
vault_ha_rpc_client_forward_count / _errorsSummary / CounterStandby-to-active request forwarding count and errors
vault_ha_rpc_client_echo_count / _errorsSummary / CounterStandby-to-active heartbeat count and errors

Raft and Autopilot

MetricTypeDescription
vault_raft_storage_stats_commit_indexGaugeMember Raft commit index
vault_raft_storage_stats_applied_indexGaugeMember Raft applied index
vault_raft_storage_stats_fsm_pendingGaugeLog entries pending application to the state machine
vault_raft_storage_follower_applied_index_deltaGaugeFollower lag in log entries; reported only by the leader, with peer_id
vault_raft_storage_follower_last_heartbeat_msGaugeMilliseconds since follower heartbeat; leader only, with peer_id
vault_raft_state_leaderCounterTimes this member became leader; used to observe elections
vault_raft_peersGaugeNumber of Raft peers
vault_raft_applyCounterRaft log writes
vault_raft_commitTimeSummary (ms)Raft log commit duration
vault_raft_leader_lastContactSummary (ms)Time since the leader last contacted a follower
vault_raft_storage_bolt_page_bytes_allocatedGaugeAllocated BoltDB page bytes
vault_raft_storage_bolt_freelist_used_bytesGaugeBoltDB freelist bytes
vault_autopilot_healthyGaugeCluster health; leader only
vault_autopilot_failure_toleranceGaugeCluster fault tolerance; leader only
vault_autopilot_node_healthyGaugeMember health; leader only, with node_id

Secrets, tokens, and audit

MetricTypeDescription
vault_expire_num_leasesGaugeCurrent lease count
vault_expire_renew_count / vault_expire_revoke_countSummaryLease renewals and revocations
vault_token_countGaugeToken count (usage gauge)
vault_token_creationCounterToken creations
vault_secret_kv_countGaugeKV secret count (usage gauge)
vault_identity_num_entitiesGaugeIdentity entity count
vault_audit_log_request_count / vault_audit_log_response_countSummaryRequests and responses recorded by audit devices
vault_audit_log_request_failure / vault_audit_log_response_failureCounterAudit write failures; appears only after the first failure

Runtime

MetricTypeDescription
vault_runtime_num_goroutinesGaugeGoroutine count
vault_runtime_alloc_bytes / vault_runtime_sys_bytesGaugeAllocated heap memory and memory requested from the OS
vault_runtime_heap_objectsGaugeHeap object count
vault_runtime_total_gc_pause_ns / vault_runtime_total_gc_runsGaugeCumulative GC pause time and number of GC runs

Snapshot backups (from node_exporter’s textfile collector, under the node scrape job)

MetricTypeDescription
vault_backup_last_success_timestamp_secondsGaugeUnix timestamp of the latest successful local snapshot
vault_backup_size_bytesGaugeSize of the latest successful local snapshot, in bytes

vault-backup writes these two metrics to /var/lib/node_exporter/textfile/vault.prom only after success. The file is deleted when a member is removed.