Resource Usage Tracking
Ververica Platform can be configured to track the number of CPU cores used per Namespace.
Generating a Resource Usage Report
The endpoint for interacting with resource usage reports is /api/v1/status/resourceusage
.
A resource usage report can be created and downloaded via a GET
request containing the beginning and end date of the desired timeframe as request parameters from
and to
. These parameters:
- should be in LocalDate format, e.g. 2020-04-20
- are interpreted as 00:00 UTC on the given day
- are inclusive (
from
) resp. exclusive (to
)
The following example shows a request to obtain a resource usage report from 2019-09-01 to 2020-02-05.
GET /api/v1/status/resourceusage?from=2019-09-01&to=2020-02-05
This call will return a csv file with columns begin
, end
, namespace
, used
, sorted by begin
, then namespace
. Resource usage is tracked with a one-minute resolution. The report will contain a row whenever a change is detected for a namespace. If no change is detected for more than 24 hours, the latest value will be re-emitted.
# Start: 2019-09-01
# End: 2020-02-05
begin,end,namespace,used
2019-09-01T14:01:20.336368Z,2019-09-02T14:01:20.336368Z,default,2
2019-09-01T14:01:20.336368Z,2019-09-01T14:32:12.392851Z,othernamespace,1.2
2019-09-01T14:32:12.392851Z,2019-09-02T14:32:12.392851Z,othernamespace,4.4
2019-09-02T14:01:20.336368Z,2019-09-02T16:03:20.788324Z,default,2
It is possible to delete all tracked resource usage before a specified date from the database via a similar DELETE
request:
DELETE /api/v1/status/resourceusage?to=2020-02-05
By default, it is only possible to delete entries which are older than a quarter (92 days). If necessary, this restriction can be overridden by setting force=true
.
Deleting resource usage data is not reversible. Please make sure that it is not required anymore.
Both operations require the admin
role.
Configuration
To enable resource usage tracking, set the resourceConsumptionLogging property to true:
vvp:
resourceUsageTracking: true