Vault Server Metrics
Vault server’s metric endpoint supports Prometheus-formatted metrics. As with other services which expose such an endpoint, use an OpenTelemetry Collector to scrape this endpoint and get these metrics into Honeycomb. Refer to Vault’s documentation for a list of key metrics, as well as the full telemetry reference.Configure Vault
Prometheus metrics are not enabled by default. Therefore, to enable, set theprometheus_retention_time value to at least twice the scrape interval of your OpenTelemetry Collector.
The HashiCorp documentation also suggests setting disable_hostname to avoid having hostname-prefixed metrics.
A suggested configuration can be created as metrics.hcl for each Vault server, as follows:
Create a Metrics Token
Since Vault’s/sys/metrics endpoint is authenticated, we need to create both a read-metrics ACL policy and a metrics token for the OpenTelemetry Collector to use when scraping Vault metrics.
The following is an example of creating and defining a read-metrics ACL policy that grants read capabilities to the metrics endpoint:
read-metrics ACL policy is created, the next step is to create a metrics-token for use when scraping metrics from Vault.
The following is an example of writing the token ID to the file metrics in the vault configuration directory:
Configure the OpenTelemetry Collector
Scraping the Vault server’s Prometheus metrics endpoint requires configuring a OpenTelemetry Collector with a pipeline that starts with a prometheus receiver and ends with an OTLP exporter. Depending on your chosen method of Vault deployment, the resource detection processor may be helpful to further enrich the OTLP Metrics being sent to Honeycomb. The following example OpenTelemetry Collector configuration uses thesystem resource detector processor: