Skip to main content

Useful Kubecost Integration Information for OpenCost

The following sections describes the information that is useful for you when integrating with Kubecost:

CBI Mapping

The following table lists the CBI mapping automatically from the CSV column to cost dimensions/measures:

CSV ColumnDimensions/MeasuresRequiredMeaning
ClusterCloud Vendor Account Cloud Vendor Account NameYesKubernetes cluster name.
NamespaceResource GroupYesKubernetes cluster namespace name.
AggregationResource TypeYesDesired aggregation level for cost allocation data to be collected, controlled by an input parameter for the export utility. Supported values are namespace, controller, and pod. Recommended level is pod.
Controller-YesController name. A value is populated if a unique value is available for the used aggregation level.
Pod-YesPod ID. A value is populated if a unique value is available for the used aggregation level.
Container-YesContainer name. A value is populated if a unique value is available for the used aggregation level.
Node-YesNode name. A value is populated if a unique value is available for the used aggregation level.
ResourceIDResource IDYesKubernetes resource ID. Based on the aggregation level, the resource ID pattern is as follows: Aggregation = namespace: ResourceID = <cluster name>/<namespace name> Aggregation = controller: ResourceID = <cluster name>/<namespace name>/<controller name> Aggregation = pod: ResourceID = <cluster name>/<namespace name>/<pod ID>
CostCostYesThe total cost for this record in the currency specified by Currency.
CurrencyCurrency CodeYesThe currency code is defaulted to USD.
UsageTypeUsage TypeYesRepresents the kind of usage incurred. For example, CPU usage, persistent volume usage, and so on. Sample values are cpuCost, ramCost, pvCost.
UsageAmountUsage AmountYesThe amount of usage generated for this record.
UsageUnitUsage UnitYesThe units that the Usage Amount metric is reported in. Sample values are cpuCoreHours, ramByteHours, pvBytesHours.
ControllerKind-YesA kind of controller. A value is populated if a unique value is available for the used aggregation level. Sample values are deployment, job, statefulset.
ProviderID-YesProvider ID for the node. A value is populated when the node is known.
Labels-YesKubernetes labels of the resource. Can be used for defining custom dimensions.
InvoiceYearMonth-YesThe month this usage was incurred. For example, 202305.
InvoiceDate-YesA UTC time in the RFC3339 format (for example, 2006-01-02T15:04:05Z) representing the date and time this usage was incurred.
StartTime-YesA UTC time in the RFC3339 format (for example, 2006-01-02T15:04:05Z) representing the start date and time for this record.
EndTime-YesA UTC time in the RFC3339 format (for example, 2006-01-02T15:04:05Z) representing the end date and time for this record.
CloudProviderCloud ProviderNoCan be set as the CBI parameter. Default value is Kubecost.
ChargeTypeLine Item TypeNoSet to Usage.
UsageCategoryCategoryNoSet to Compute.
ServiceServiceNoSet to Kubernetes.
BillSourceBill SourceNoBill connect Id.
CapabilityCapabilityNoSet to csm.
ManufacturerManufacturer NameNoCan be set as the CBI parameter. Default value is Kubecost.
SpendTypeSpend TypeNoSet to Cloud.

Repositories

The following public repositories contain the source code and the image of the exporter: