Vault usage metrics
Client calculation and sizing can be complex to compute when you have multiple namespaces and auth mounts. The Vault Usage Metrics dashboard on Vault UI provides the information where you can filter the data by namespace and/or auth mounts. You can also use Vault CLI or API to query the usage metrics.
Enable usage metrics
Usage metrics are a feature that is enabled by default for Vault Enterprise and HCP Vault Dedicated. However, if you are running Vault Community Edition, you need to enable usage metrics since it is disabled by default.
Open a web browser to access the Vault UI, and sign in.
Select Client Count from the left navigation menu.
Select Configuration.
Select Edit configuration.
Select the toggle for Usage data collection so that the text reads Data collection is on.
Retention period
The retention period sets the number of months for which Vault will maintain activity logs to track active clients. (Default: 48 months)
Click Save to apply the changes.
Click Continue in the confirmation dialog to enable usage metrics tracking.
Usage metrics dashboard
Sign into Vault UI. The Client count section displays the total number of clients for the current billing period.
Select Details.
Examine the Vault Usage Metrics dashboard to learn your Vault usage.
Usage metrics data categories
Running client total are the primary metric on which pricing is based. It is the sum of entity clients (or distinct entities) and non-entity clients.
Entity clients (distinct entities) are representations of a particular user, client, or application that belongs to a defined Vault entity. If you are unfamiliar with Vault entities, refer to the Identity: Entities and Groups tutorial.
Non-entity clients are clients without an entity attached. This is because some customers or workflows might avoid using entity-creating authentication methods and instead depend on token creation through the Vault API. Refer to understanding non-entity tokens to learn more.
Note
The non-entity client count excludes
root
tokens.Secrets sync clients are the number of external destinations Vault connects to sync the secrets. Refer to the documentation for more details.
ACME clients are the ACME connections that authenticate under the same certificate identifier (domain) as the same certificate entity for client count calculations. Refer to the documentation for more details.
Select a data range
Under the Client counting period, select Edit to query the data for a different billing period.
Keep in mind that Vault begins collecting data when the feature is enabled. For example, if you enabled the usage metrics in March of 2023, you cannot query data in January of 2023.
Vault will return metrics from March of 2023 through most recent full month.
Filter by namespaces
If you have namespaces, the dashboard displays the top ten namespaces by total clients.
Use the Filters to view the metrics data of a specific namespace.
Mount attribution
The clients are also shown as graphs per auth mount. The Mount attribution section displays the top auth mounts where you can expect to find your most used auth method mounts with respect to client usage. This allows you to detect which auth mount had the most number of total clients in the given billing period. You can filter for auth mounts within a namespace, or view auth mounts across namespaces. The mount attribution is available even if you are not using namespaces.
Query usage metrics via CLI
Retrieve the usage metrics for the current billing period.
Example output:
The output shows client usage metrics for each namespace.
Filter by namespace
You can narrow the scope for education
namespace and its child namespaces.
Query with a time frame
To query the client usage metrics for the month of June, 2024. The start
time is June 1, 2024 (2024-06-01T00:00:00Z
) and the end time is June
30, 2024 (2024-06-30T23:59:59Z
).
The start_time
and end_time
should be an RFC3339 timestamp or Unix epoch
time.
Example output:
Export the metrics data
You can export the metrics data by clicking on the Export attribution data button.
This downloads the usage metrics data on your local drive in comma separated
values format (.csv
) or JSON.
API
- Refer to the
sys/internal/counters
page to retrieve client count using API. - Activity export API to export activity log.