As of v1.106 of Kubecost, the Audit API is deprecated. This page should not be consulted.
The Audit API applies a series of tests to the various cached data sources of Kubecost to check the validity of the data sources and the processes that act upon them. Each of the Audits tests represents an invariance that should remain true despite any changes that occur to the system as a whole. Each Audit is stored in an AuditSet, which besides audits contains a window for the timeframe that the Audits it contains cover. The Audits themselves each have a timestamp for their last run, a status, a description and other audit-specific structures which contain the results of the run.
Audit types are optional parameters to filter your requests to audit select parts of your workload or perform additional actions. The endpoint for using an audit type will look like:
The base return types are used by each Audit result to express any discrepancies that have been detected.
Audit Missing Value
Audit Missing Value denotes a value that was present in one data source and not another. The presence of this base result will generally result in a Warning status in the Audit that contains it. It contains a
Descriptionof the missing value and the
keywhich acts as a way of identifying the missing value.
Audit Float Result
Audit Float Result represents a difference in float values between two data sources. The presence of this base result generally indicates a Failed status on the Audit. It contains an
Actualvalue derived from the data source being audited and
Expectedvalue which is generated by the Audit itself.
Each Audit result contains the following values.
status: gives the end result of the Audit as
lastRun: a timestamp of when the Audit was run
description: a string describing the result of the audit. Generally used for failures in preliminary checks.
*AuditMissingValuecontaining any values that were found to be missing during the audit
Allocation Reconciliation Audit
Allocation Reconciliation Audit records the differences of between compute resources (CPU, RAM, GPU) costs between allocations by nodes and node assets. It contains the additional fields:
map[string]map[string]*AuditFloatResultrecords difference in resource values between asset and allocations. Keyed on node name and resource name
Total Audit records the differences between a total store and the totaled results of the store. It contains the additional fields:
map[string]*AuditFloatResultwhich records differences of calculated total by node. Keyed on node name
map[string]*AuditFloatResultwhich records differences of calculated total by cluster. Keyed on cluster id
Agg Audit contains the results of an Audit on an AggStore which checks if the aggregate of the store it draws from matches it.
map[string]map[string]*AuditFloatResultwhich records differences of calculated agg. Keyed on aggregation prop and allocation or asset key
Asset Reconciliation Audit
Asset Reconciliation Audit records differences in assets and the Cloud items that it is able to successfully match.
map[string]map[string]*AuditFloatResultwhich records differences in cloud assets and matched assets. Keyed on providerId and category
Equality Audit records the difference in cost between Allocations and Assets aggregated by cluster and Keyed on cluster
map[string]*AuditFloatResultwhich records differences in allocations by cluster and assets by cluster. Keyed by cluster id