Supported telemetry types
The HashiCorp Vault integration supports these telemetry types:Prerequisites
The HashiCorp Vault integration has the following prerequisites:-
Enable the Vault Prometheus telemetry endpoint. Make sure that
prometheus_retention_timeis greater than0: -
Make the Vault API root, such as
https://vault.example.com:8200/v1, reachable from the Collector. -
Choose one authentication method for
/v1/sys/metrics:-
Create a Vault token in the root namespace with
readandlistaccess tosys/metrics. Supply the token directly or through a Collector-local file. -
Enable unauthenticated metrics access in the Vault TCP listener:
Configure the target with
no_token: true. Unauthenticated metrics access is also required to collect each standby node’s own metrics.
-
Create a Vault token in the root namespace with
Configure
The HashiCorp Vault integration is enabled by default. To configure it, follow these steps:- For discovered Vault targets, add autodiscovery annotations that provide each target’s Vault API URL and token or no-token setting. For more information, see autodiscovery.
-
Optional: Configure static instances as an alternative to autodiscovery. The
Collector scrapes exactly the targets in a non-empty
instanceslist and turns off discovery for that integration instance. To use both methods, add a named integration instance. For example:The defaultvaultintegration continues to use autodiscovery. Thevault/externalkey defines a second integration instance that scrapes only the listed targets.
Validate
To validate the HashiCorp Vault integration, follow these steps:-
In Live Telemetry Analyzer, filter for
__name__=cxdot.integration.target.healthandcxdot.integration.name=vault. Confirm that each expected target reports1. A value of1means that the Vault API health and leadership requests succeeded. A value of0means that they failed. Use theserver.addressandserver.portattributes to identify each target. -
In Metrics Explorer, run the following query while Vault handles requests:
Confirm that the query returns the expected time series for each target. The
vault.cluster,vault.version, andvault.is_leaderattributes identify the Vault cluster, version, and leadership state.
Troubleshooting
cxdot.integration.target.healthreports1, but workload metrics don’t appear: Confirm that the token hasreadandlistaccess tosys/metrics, or that the target enables unauthenticated metrics access and usesno_token: true.- A disaster recovery secondary reports API status metrics but no workload metrics:
Set
collect_secondary_dr: truefor that target. The integration omits workload metrics from disaster recovery secondaries by default.
Configuration reference
Configure one Vault integration instance with the following settings. In Helm values, place these settings underconfig.integrations.vault. In a Collector configuration file, place them
under cxdot.integrations.vault.
Optional settings
-
enabledType:boolean. Optional. Default:true. Whether to enable this Vault integration instance. If true, the Collector collects metrics from configured or discovered targets. If false, the Collector doesn’t run this integration instance. -
collection_intervalType:duration. Optional. Default:15s. How often the Collector collects metrics from each Vault target. -
timeoutType:duration. Optional. Default:10s. Maximum time the Collector waits for a Vault target to respond during one collection. This value must not exceedcollection_interval. If the deadline expires, that collection fails. -
max_samplesType:integer. Optional. Default:0. Minimum:0. Maximum samples accepted from one metrics response. Zero disables the sample-count limit. Decompressed responses larger than 16 MiB are always rejected. -
follow_redirectsType:boolean. Optional. Default:true. Whether to follow HTTP redirects. If true, the Collector follows redirects. If false, a redirect causes the metric collection to fail. -
instancesType:array of object. Optional. Default:[]. Static Vault API targets used outside annotation discovery. -
instances[].endpointType:uri. Required. Base Vault API URL ending in /v1. -
instances[].client_tokenType:string. Optional. Token with read and list access to the metrics endpoint. -
instances[].client_token_pathType:string. Optional. Collector-local path containing a Vault token. -
instances[].no_tokenType:boolean. Optional. Default:false. Scrape metrics without a token when unauthenticated access is enabled. -
instances[].collect_secondary_drType:boolean. Optional. Default:false. Collect metrics when the target reports that it’s a disaster-recovery secondary. -
instances[].tlsType:object. Optional. TLS settings for this target. -
instances[].tls.ca_fileType:string. Optional. Path to a PEM-encoded certificate authority (CA) certificate file used to verify the Vault server certificate. If omitted, the Collector uses the system certificate authority pool. -
instances[].tls.ca_pemType:string. Optional. PEM-encoded certificate authority certificate content used to verify the Vault server certificate. -
instances[].tls.cert_fileType:string. Optional. Path to the PEM-encoded client certificate file to present when the Vault target requires mutual TLS authentication. -
instances[].tls.cert_pemType:string. Optional. PEM-encoded client certificate content to present when the Vault target requires mutual TLS authentication. -
instances[].tls.cipher_suitesType:array of string. Optional. TLS cipher suites that the Collector can use, in preference order. If omitted, the Collector uses the secure defaults from the Go TLS library. For supported names, see https://go.dev/src/crypto/tls/cipher_suites.go. -
instances[].tls.curve_preferencesType:array of string. Optional. Elliptic curves that the Collector can use for an elliptic curve Diffie-Hellman ephemeral handshake, in preference order. If omitted, the Collector uses the Go TLS library defaults. -
instances[].tls.include_system_ca_certs_poolType:boolean. Optional. Whether to add certificates from the system certificate authority pool to the configured certificate authorities. If true, the Collector trusts both sources. If false, the Collector trusts only the configured certificate authorities. -
instances[].tls.insecureType:boolean. Optional. Whether to disable transport security. If true, the Collector uses an unencrypted connection. If false, the Collector uses TLS. -
instances[].tls.insecure_skip_verifyType:boolean. Optional. Whether to skip verification of the Vault server certificate. If true, the connection is encrypted but isn’t authenticated and is vulnerable to man-in-the-middle attacks. If false, the Collector verifies the certificate. -
instances[].tls.key_fileType:string. Optional. Path to the PEM-encoded client private key file used withcert_filefor mutual TLS authentication. -
instances[].tls.key_pemType:string. Optional. PEM-encoded client private key content used withcert_pemfor mutual TLS authentication. -
instances[].tls.max_versionType:string. Optional. Maximum TLS protocol version the Collector can use. If omitted, the Collector uses the maximum version supported by the Go TLS library. -
instances[].tls.min_versionType:string. Optional. Minimum TLS protocol version the Collector can use. If omitted, the minimum version is TLS 1.2. -
instances[].tls.reload_intervalType:duration. Optional. How often the Collector reloads certificate and key files. If omitted, the Collector doesn’t reload the files. -
instances[].tls.server_name_overrideType:string. Optional. Server name to verify in the Vault certificate instead of the endpoint hostname. Use this setting when the certificate name differs from the endpoint hostname. -
instances[].tls.tpmType:object. Optional. Trusted platform module settings for the TLS private key. -
instances[].tls.tpm.authType:string. Optional. Authorization value for the trusted platform module key. -
instances[].tls.tpm.enabledType:boolean. Optional. Whether to use a trusted platform module for the TLS private key. If true, the Collector loads the key from the configured device or socket. If false, the Collector uses the configured key file or in-memory key. -
instances[].tls.tpm.owner_authType:string. Optional. Authorization value for the trusted platform module owner. -
instances[].tls.tpm.pathType:string. Optional. Path to the trusted platform module device or Unix domain socket, such as/dev/tpm0or/dev/tpmrm0.