/sys/internal/counters
The /sys/internal/counters
endpoints are used to return data about the number of Http Requests, Tokens, and Entities in Vault.
NOTE: This endpoint is only available in Vault version 1.3+. Backwards compatibility is not guaranteed. These endpoints are subject to change or may disappear without notice.
Http Requests
This endpoint lists the number of Http Requests made per month.
Method | Path |
---|---|
GET | /sys/internal/counters/requests |
Sample Request
Sample Response
Entities
This endpoint returns the total number of Entities.
Method | Path |
---|---|
GET | /sys/internal/counters/entities |
Sample Request
Sample Response
Tokens
This endpoint returns the total number of Tokens.
Method | Path |
---|---|
GET | /sys/internal/counters/tokens |
Sample Request
Sample Response
Client Count
This endpoint returns the number of clients per namespace, as the sum of active entities and non-entity tokens. An "active entity" is a distinct entity that has created one or more tokens in the given time period. A "non-entity token" is a token with no attached entity ID.
A time period may be specified; otherwise it reports on a default reporting period, such as the previous twelve calendar months. Reports are only available with month granularity, after each month has completed. The response includes the actual time period covered, which may not exactly match the query parameters due to the monthly granularity of the data, or missing months in the requested time range.
The response will include all child namespaces of the namespace in which the request was made. If some namespace has subsequently been deleted, its path will be listed as "deleted namespace :ID:". Deleted namespaces are reported only for queries in the root namespace, because the information about the namespace path is unknown.
This endpoint was added in Vault 1.6.
Method | Path |
---|---|
GET | /sys/internal/counters/activity |
Parameters
start_time
(string, optional)
- An RFC3339 timestamp or Unix epoch time. Specifies the start of the period for which client counts will be reported. If no start time is specified, thedefault_report_months
prior to theend_time
will be used.end_time
(string, optional)
- An RFC3339 timestamp or Unix epoch time. Specifies the end of the period for which client counts will be reported. If no end time is specified, the end of the previous calendar month will be used.
Sample Request
Sample Response
Sample request for a single month
Partial Month Client Count
This endpoint returns the number of clients for the current month, as the sum of active entities and non-entity tokens. An "active entity" is a distinct entity that has created one or more tokens in the given time period. A "non-entity token" is a token with no attached entity ID.
The time period is from the start of the current month, up until the time that this request was made.
Note: the client count may be inaccurate in the moments following a Vault reboot, or leadership change. The estimate will stabilize when background loading of client data has completed.
This endpoint was added in Vault 1.7.
Method | Path |
---|---|
GET | /sys/internal/counters/activity/monthly |
Sample Request
Sample Response
Update the Client Count Configuration
The /sys/internal/counters/config
endpoint is used to configure logging of active clients.
Method | Path |
---|---|
POST | /sys/internal/counters/config |
Parameters
default_report_months
(integer: 12)
- The number of months to report if nostart_time
is specified in a query.enabled
(string: enable, disable, default)
- Enable or disable counting of client activity. When set todefault
, the client counts are enabled on Enterprise builds and disabled on OSS builds. Disabling the feature during the middle of a month will discard any data recorded for that month, but does not delete previous months.retention_months
(integer: 24)
- The number of months of history to retain.
Any missing parameters are left at their existing value.
Sample Payload
Sample Request
Read the Client Count Configuration
Reading the configuration shows the current settings, as well as a flag as to whether any data can be queried.
enabled
(string)
- returnsdefault-enabled
ordefault-disabled
if the configuration isdefault
.queries_available
(bool)
- indicates whether any usage report is available. This will initially be false until the end of the first calendar month after the feature is enabled.
Sample Request
Sample Response