Understand metric prefixes and recording rules

Use this reference to map OpenBao source metrics to the normalized recording rules used by this project. It is for operators who need to configure metric prefixes, read generated alerts, or adapt the dashboards to an existing Prometheus-compatible backend.

Prefix strategy

OpenBao still documents vault as the default telemetry prefix. This project therefore treats vault_* as the default source metric family and supports openbao_* when you explicitly configure metrics_prefix = "openbao".

LayerExampleMeaning
OpenBao docs metric namevault.core.activeThe upstream metric name used in OpenBao documentation.
Prometheus source metricvault_core_activeThe Prometheus exposition name when metrics_prefix = "vault".
Alternate source metricopenbao_core_activeThe Prometheus exposition name when metrics_prefix = "openbao".
Recording ruleopenbao:core_active:sumThe normalized project rule used by dashboards and alerts.

Use source metrics for capture and validation. Use recording rules for dashboards and critical alerts when a rule exists.

Choose a prefix

PrefixUse whenTradeoff
vaultYou want the OpenBao default and the widest compatibility with existing examples.The name still carries historical Vault terminology.
openbaoYou intentionally want OpenBao-branded source metrics.Existing dashboards, alerts, and filters that hardcode vault_* must change.

Set the prefix in the OpenBao telemetry stanza.

telemetry {
  prometheus_retention_time = "30s"
  disable_hostname          = true
  metrics_prefix            = "vault"
}

If you use prefix_filter, write filters for the configured OpenBao prefix. For example, use +openbao.core only when you also set metrics_prefix = "openbao".

Use normalized rules

The generated recording rules use the openbao: namespace even when the source metric prefix is vault. This keeps Grafana dashboards and alert expressions stable across deployments.

SignalSource metric with vault prefixSource metric with openbao prefixRecording rule
Active node countvault_core_activeopenbao_core_activeopenbao:core_active:sum
Unsealed node countvault_core_unsealedopenbao_core_unsealedopenbao:core_unsealed:sum
Audit request failuresvault_audit_log_request_failureopenbao_audit_log_request_failureopenbao:audit_log_request_failure:increase5m
Audit response failuresvault_audit_log_response_failureopenbao_audit_log_response_failureopenbao:audit_log_response_failure:increase5m
Token countvault_token_countopenbao_token_countopenbao:token_count:max30m
Token creationvault_token_creationopenbao_token_creationopenbao:token_creation:increase15m
Lease countvault_expire_num_leasesopenbao_expire_num_leasesopenbao:expire_num_leases:max
Irrevocable leasesvault_expire_num_irrevocable_leasesopenbao_expire_num_irrevocable_leasesopenbao:expire_num_irrevocable_leases:max
Goroutinesvault_runtime_num_goroutinesopenbao_runtime_num_goroutinesopenbao:runtime_num_goroutines:max
Heap objectsvault_runtime_heap_objectsopenbao_runtime_heap_objectsopenbao:runtime_heap_objects:max
System bytesvault_runtime_sys_bytesopenbao_runtime_sys_bytesopenbao:runtime_sys_bytes:max
Barrier GET latencyvault_barrier_getopenbao_barrier_getopenbao:barrier_get:avg5m
Barrier PUT latencyvault_barrier_putopenbao_barrier_putopenbao:barrier_put:avg5m
Cache hit ratiovault_cache_hit, vault_cache_missopenbao_cache_hit, openbao_cache_missopenbao:cache_hit_ratio:ratio5m
Mount table entriesvault_core_mount_table_num_entriesopenbao_core_mount_table_num_entriesopenbao:core_mount_table_num_entries:max
Raft peer countvault_raft_peersopenbao_raft_peersopenbao:raft_peers:max
Autopilot healthvault_autopilot_healthyopenbao_autopilot_healthyopenbao:autopilot_healthy:max

The repository ships generated rule variants for both supported source prefixes. Use the variant that matches the metrics your OpenBao deployment emits.

Source prefixNative Prometheus rulesPrometheus Operator rules
vaultgenerated/prometheus/vault-prefix/generated/prometheusrules/vault-prefix/
openbaogenerated/prometheus/openbao-prefix/generated/prometheusrules/openbao-prefix/

The top-level generated/prometheus/openbao-recording-rules.yaml and generated/prometheusrules/openbao-recording-rules.yaml files remain the default vault variant for the local Docker Compose stack.

Regenerate all variants after you change the metric contract, alert contracts, or generator code.

make generate

You can still generate a single custom output with --source-prefix when you need a one-off path.

go run ./cmd/openbao-observability generate prometheus-rules \
  --contract contracts/metrics/openbao-core.yaml \
  --source-prefix openbao \
  --output /tmp/openbao-recording-rules.yaml \
  --rule-output /tmp/openbao-native-rules.yaml

Query source metrics during validation

Use source metrics when you need to confirm what OpenBao emits.

vault_core_active
vault_core_unsealed
vault_audit_log_request_failure
vault_runtime_num_goroutines
vault_barrier_get
vault_cache_hit

For an openbao-prefixed deployment, replace vault_ with openbao_.

Use compatibility queries only during migration or discovery. Regex selectors over metric names are useful for exploration, but generated dashboards and alerts should use direct source metrics or normalized recording rules.

{__name__=~"^(vault|openbao)_core_active$"}

Account for label differences

Raw OpenBao metrics do not expose one uniform label set. Some core metrics include an OpenBao cluster label, some development and fixture profiles emit an empty cluster="" series, and some runtime or lease metrics rely on scrape labels instead.

Recording rules in this project normalize the signals that dashboards need. When you write custom queries, check the live label set before grouping by cluster, namespace, pod, or instance.

Raft peer count behavior

The HA/Raft dashboard uses openbao:raft_peers:max instead of raw vault_raft_peers. The normalized rule prefers the raw Raft peer metric when OpenBao exposes it and falls back to counting *_raft_storage_stats_commit_index by peer_id in all-node scrape profiles.

This fallback exists because the current OpenBao 2.5.4 HA/Raft fixture observed vault_raft_peers on the active node, while the live Docker Compose all-node scrape exposed Raft storage stats without vault_raft_peers.

Validate generated artifacts

Run the repository verification target after you change metric prefixes, recording rules, alert contracts, or dashboard contracts.

make verify

When the Docker Compose stack is already running, validate dashboard queries against Prometheus and Loki.

make verify-live
FilePurpose
contracts/metrics/openbao-core.yamlDefines source metric names, supported prefixes, fixture expectations, and normalization notes.
generated/prometheus/openbao-recording-rules.yamlNative Prometheus rule file for the local Compose stack.
generated/prometheusrules/openbao-recording-rules.yamlPrometheus Operator PrometheusRule artifact.
generated/prometheus/vault-prefix/Native Prometheus rules for OpenBao deployments that emit vault_* metrics.
generated/prometheus/openbao-prefix/Native Prometheus rules for OpenBao deployments that emit openbao_* metrics.
generated/prometheusrules/vault-prefix/Prometheus Operator rules for OpenBao deployments that emit vault_* metrics.
generated/prometheusrules/openbao-prefix/Prometheus Operator rules for OpenBao deployments that emit openbao_* metrics.
contracts/dashboards/openbao-overview.yamlOverview dashboard contract that consumes normalized rules.
contracts/dashboards/openbao-ha-raft.yamlHA/Raft dashboard contract that consumes normalized rules and validated Raft source metrics.
contracts/dashboards/openbao-audit-investigation.yamlAudit investigation dashboard contract that uses query-time audit fields without turning them into Loki labels.
contracts/dashboards/openbao-auth-identity.yamlAuth and identity dashboard contract that filters audit request paths at query time without turning them into Loki labels.
contracts/dashboards/openbao-token-lease-lifecycle.yamlToken and lease lifecycle dashboard contract that consumes normalized token and lease rules plus query-time audit fields.
contracts/dashboards/openbao-secret-engines-mounts.yamlSecret engines and mounts dashboard contract that filters engine paths at query time without turning mount paths into Loki labels.
contracts/dashboards/openbao-transit.yamlTransit dashboard contract that filters key management and cryptographic audit paths at query time without turning Transit key names into Loki labels.
contracts/dashboards/openbao-pki.yamlPKI dashboard contract that consumes normalized PKI rules and filters certificate lifecycle audit paths at query time.
contracts/dashboards/openbao-runtime-storage.yamlRuntime and storage dashboard contract that consumes normalized runtime, barrier, cache, and mount-table rules.
contracts/dashboards/openbao-namespaces-scale.yamlNamespaces and scale dashboard contract that consumes namespace-aware token and lease rules plus Raft read-replica diagnostics.
contracts/dashboards/openbao-kubernetes-platform.yamlKubernetes platform dashboard contract that consumes kube-state-metrics, kubelet, cAdvisor, scrape target, and platform event signals.
contracts/dashboards/openbao-slo-availability.yamlSLO and availability dashboard contract that consumes optional synthetic probe metrics, OpenBao latency rules, and scrape availability signals.
contracts/alerts/critical.yamlAlert contract that maps critical alerts to runbooks.
contracts/alerts/warning.yamlAlert contract that maps warning alerts to runbooks.

What’s next

Source: OpenBao documents metrics_prefix, disable_hostname, prometheus_retention_time, prefix_filter, and Prometheus scrape behavior in the OpenBao telemetry documentation . OpenBao documents the /sys/metrics endpoint and Prometheus output examples in the OpenBao metrics API documentation .