Cost Events Audit API
Note: This feature is in a beta state. It has limitations. Please read the documentation carefully.
Note: This feature is only officially supported on Kubecost Enterprise plans.
The Cost Events Audit API aims to offer improved visibility on recent changes at cluster level and their estimated cost impact.
Cost events Audit API
GET
http://<your-kubecost-address>/model/audit/events
Accesses the most recent cluster events and their predicted cost impact
Path Parameters
Name | Type | Description |
---|---|---|
count | int | Number of events to return. If unspecified, it returns all events available. |
filterNamespaces | string | Comma-separated list of namespaces to match; e.g. |
filterEventTypes | string | Filter query by event type. Currently, only |
filterResourceTypes | string | Resource type. Currently, only |
filterTotalCostLowerBound | float | Floating-point value representing the lower bound for the total event cost. |
filterTotalCostUpperBound | float | Floating-point value representing the upper bound for the total event cost. |
Enabling the Cost Events Audit API
This API is disabled by default. It needs to be manually enabled first through Helm, using the following parameters:
You can also enable the Cost Events Audit API by setting the COST_EVENTS_AUDIT_ENABLED
environment variable to true
.
Event tracking
Changes at cluster level can range from actions triggered by declarative statements submitted by users (e.g. creation of a Deployment) to automated actions (e.g. cluster autoscaling) or performance events. We detect changes that would have an impact on the overall cluster cost using watchers on the Kubernetes API client.
The watchers are tracking change events across all namespaces within the local/primary cluster (the cluster that the instance of Kubecost you are interacting with via HTTP is running on).
Supported events
Deployment creation
Deployment deletion
StatefulSet creation
StatefulSet deletion
Estimated cost impact
Cost implications of cluster events are handled by passing the Kubernetes spec inferred from the change event to the Kubecost Predict API.
Current limitations
The Cost Events Audit API can return up to 1000 of the most recent cluster events. There is no time expiration limit on the events.
Events returned by the Cost Events Audit API are currently not persisted between Kubecost pod restarts.
The Cost Events Audit API does not track events for clusters other than the local/primary cluster.
Last updated