Metrics

This page is the authoritative reference for the Prometheus metrics and stable JSON log fields exported by bao-kms-provider. For observability principles, error classes, health endpoints, and alerts, see Reference: Observability .

Endpoint

Prometheus metrics are served by bao-kms-provider serve on server.metricsAddress at /metrics. The default address is 127.0.0.1:8081, so the endpoint is not reachable from off-host without explicit configuration.

Label Rules

The provider applies these rules to every metric:

  • bounded label values only,
  • key_id values are exported as hashes, never raw,
  • raw OpenBao paths are not exported,
  • raw key names are not exported,
  • Kubernetes object names are not used as labels,
  • request UIDs are not used as labels,
  • full error strings are not used as labels.

Metric Reference

KMS gRPC Surface

MetricTypeLabelsDescription
openbao_kms_grpc_requests_totalcountermethod, statusKMS v2 gRPC method invocations and outcomes (status, encrypt, decrypt).
openbao_kms_grpc_duration_secondshistogrammethodPer-method latency for KMS v2 gRPC handlers.

OpenBao Calls

MetricTypeLabelsDescription
openbao_kms_openbao_requests_totalcounteroperation, statusOpenBao API call counts by operation (jwt_login, cert_login, token_renew_self, transit_metadata_read, transit_disable_upsert_read, transit_encrypt, transit_decrypt, transit_batch_decrypt, capabilities_self) and outcome.
openbao_kms_openbao_duration_secondshistogramoperationPer-operation latency for OpenBao calls.

Metric operation label values are normalized for Prometheus. The matching log openbao_operation field uses the unnormalized operation names with spaces.

Auth And Token

MetricTypeLabelsDescription
openbao_kms_auth_login_totalcounterstatusAuth-method login attempts by outcome.
openbao_kms_auth_renewal_totalcounterstatusToken renewal attempts by outcome.
openbao_kms_auth_method_infogaugemethodReports 1 for the configured bounded auth method (jwt, cert, or unknown).
openbao_kms_certificate_source_infogaugesourceReports 1 for the configured bounded certificate source (pkcs11, spiffe, none, or unknown).
openbao_kms_token_ttl_secondsgaugenoneRemaining TTL of the current OpenBao token.
openbao_kms_certificate_ttl_secondsgaugenoneRemaining TTL of the current cert-auth client certificate. Zero when certificate auth is not in use or no certificate has been observed.

Active Key

MetricTypeLabelsDescription
openbao_kms_status_key_id_hashgaugehashReports 1 for the current Kubernetes key_id hash. The label value is the base64url-sha256 of the active key_id.
openbao_kms_key_versiongaugenoneActive OpenBao Transit key version used for new encrypt operations.

Status And Probes

MetricTypeLabelsDescription
openbao_kms_status_cache_age_secondsgaugenoneAge of the cached KMS Status response.
openbao_kms_transit_metadata_observation_totalcounterstatusBackground Transit metadata probe outcomes.

Rotation

MetricTypeLabelsDescription
openbao_kms_rotation_stategaugestateReports 1 for the current bounded rotation state (active, pending, unknown). Use rotation-plan for detailed promotion state.

Validation Errors

MetricTypeLabelsDescription
openbao_kms_aad_validation_errors_totalcounterreasonAAD validation failures during decrypt.
openbao_kms_decrypt_key_id_errors_totalcounterreasonDecrypt rejections caused by unknown, malformed, or stale-disallowed key_id.

Runtime Health

MetricTypeLabelsDescription
openbao_kms_circuit_breaker_stategaugenoneOpenBao client circuit breaker state.
openbao_kms_panic_recoveries_totalcountermethodRecovered KMS handler panics by bounded method. Panic values are not exported.
openbao_kms_socket_restarts_totalcounternoneSocket reclamations after stale socket detection.

Log Fields

Stable JSON log fields. Operators can rely on these names across preview patch releases.

FieldTypeDescription
tsstringRFC 3339 timestamp.
levelstringLog level (debug, info, warn, error).
messagestringStable event name (kms.request, openbao.request, auth.login, auth.renewal, status.probe, socket.stale_removed).
operationstringLogical operation name in logs (kms.encrypt, kms.decrypt, kms.status, openbao.request, auth.login, auth.renewal, status.probe, socket.stale_removed).
openbao_operationstringSpecific OpenBao call when operation=openbao.request (jwt login, cert login, token renew self, transit metadata read, transit disable_upsert read, transit encrypt, transit decrypt, transit batch decrypt, capabilities self).
statusstringOperation outcome (ok, error).
duration_msnumberOperation latency in milliseconds.
key_id_hashstringbase64url-sha256 of the active key_id. Never the raw key_id.
transit_key_versionnumberOpenBao Transit key version associated with the operation.
openbao_request_idstringOpenBao request ID when debug correlation is enabled and OpenBao returned a safe ID.
probe_kindstringStatus-controller probe kind (metadata, deep) on status.probe events.
healthzstringKMS v2 Status health value on kms.status request events.
error_classstringOne of the stable error classes; see Observability: Error Classes .
request_uid_hashstringHash of the KMS request UID when debug correlation is enabled.
debug_correlation_incidentstringOperator-supplied incident ID when debug correlation is enabled.
debug_correlation_expires_atstringRFC 3339 timestamp at which debug correlation will expire.
panic_recoveredbooleanPresent only when a KMS handler panic was recovered and redacted.
panic_typestringRuntime type of the recovered panic value. The panic value itself is never logged.

The provider must never include plaintext, jwt, openbao_token, ciphertext, transit_key_material, raw openbao_path, or raw key_name fields in any log entry.