Advanced Reporting is a beta feature. Read the documentation carefully.
Advanced Reporting allows teams to sculpt and tailor custom reports to easily view the information they care about. Providing an intersection between Kubernetes allocation and cloud assets data, this tool provides insight into important cost considerations for both workload and external infrastructure costs.
Begin by accessing the Reports page. Select Create a report, then select Advanced Report. The Advanced Reporting page opens.
Advanced Reporting will display your Allocations data and allow for similar configuring and editing. However, that data can now also intersect your cloud service, provider, or accounts.
Some line items will display a magnifying lens icon next to the name. Selecting this icon will provide a Cloud Breakdown which compares Kubernetes costs and out-of-cluster (OOC) costs. You will also see OOC costs broken down by cloud service provider (CSP).
The Advanced Reporting page manages the configurations which make up a report. Review the following tools which specify your query:
Configuration | Description |
---|---|
The Service aggregation in this context refers to a Kubernetes object that exposes an interface to outside consumers, not a CSP feature.
Selecting Edit will open a slide panel with additional configuration options.
When a filter is applied, only results matching that value will display.
Field to handle default and custom shared resources (adjusted on the Settings page). Configure custom shared overhead costs, namespaces, and labels
After completing all configurations for your report, select Save. A name for your report based on your configuration will be auto-generated, but you have the option to provide a custom name. Finalize by selecting Save.
Reports can be saved via your organization like Allocations and Assets reports, instead of locally.
Line items that possess any out-of-cluster (OOC) costs, ie. cloud costs, will display a magnifying lens icon next to their name. Selecting this icon will open a slide panel that compares your K8s and OOC costs.
You can choose to aggregate those OOC costs by selecting the Cloud Breakdown button next to Aggregate By then selecting from one of the available options. You can aggregate by Provider, Service, Account, or use Custom Data Mapping to override default label mappings.
Date Range
Manually select your start and end date, or choose a preset option. Default is Last 7 days.
Aggregate By
Field by which to aggregate results, such as by Namespace, Cluster, etc.
Reports are saved queries from your various Monitoring dashboards which can be referenced at a later date for convenience. Aggregation, filters, and other details of your query will be saved in the report, and the report can be opened at any time. Reports are currently supported by the Allocations, Assets, and Cloud Cost Explorer dashboards.
Reports can be managed via values.yaml or the Kubecost UI. This reference outlines the process of configuring saved reports through a values file, and provides documentation on the required and optional parameters.
Begin by selecting Create a report. There are five report types available. Three of these correspond to Kubecost's different monitoring dashboards. The other two are specialized beta features.
Allocation Report
Asset Report
Advanced Report (beta)
Cloud Cost Report
Selecting a monitoring report type will take you to the respective dashboard. Provide the details of the query, then select Save. The report will now be saved on your Reports page for easy access.
For help creating an Advanced Report (either type), select the respective hyperlink above for a step-by-step process.
After creating a report, you are able to share that report in recurring intervals via email as a PDF or CSV file. Shared reports replicate your saved query parameters every interval so you can view cost changes over time.
Sharing reports is only available for Allocations, Assets, and Cloud Cost Reports, not either type of Advanced Report.
In the line for the report you want to share, select the three horizontal dots icon in the Actions column. Select Share report from the menu. The Share Report window opens. Provide the following fields:
Interval: Interval that recurring reports will be sent out. Supports Daily, Weekly, and Monthly. Weekly reports default to going out Sunday at midnight. Monthly reports default to midnight on the first of the month. When selecting Monthly and resetting on a day of the month not found in every month, the report will reset at the latest available day of that month. For example, if you choose to reset on the 31st, it will reset on the 30th for months with only 30 days.
Format: Supports PDF or CSV.
Add email: Email(s) to distribute the report to.
Select Apply to finalize. When you have created a schedule for your report, the selected interval will be displayed in the Interval column of your Reports page.
The saved report settings, under global.savedReports
, accept two parameters:
enabled
determines whether Kubecost will read saved reports configured via values.yaml; default value is false
reports
is a list of report parameter maps
The following fields apply to each map item under the reports
key:
title
the title/name of your custom report; any non-empty string is accepted
window
the time window the allocation report covers, the following values are supported:
keywords: today
, week
(week-to-date), month
(month-to-date), yesterday
, lastweek
, lastmonth
number of days: {N}d
(last N days)
e.g. 30d
for the last 30 days
date range: {start},{end}
(comma-separated RFC-3339 date strings or Unix timestamps)
e.g. 2021-01-01T00:00:00Z,2021-01-02T00:00:00Z
for the single day of 1 January 2021
e.g. 1609459200,1609545600
for the single day of 1 January 2021
Note: for all window options, if a window is requested that spans "partial" days, the window will be rounded up to include the nearest full date(s).
e.g. 2021-01-01T15:04:05Z,2021-01-02T20:21:22Z
will return the two full days of 1 January 2021 and 2 January 2021
aggregateBy
the desired aggregation parameter -- equivalent to Breakdown in the Kubecost UI. Supports:
cluster
container
controller
controllerKind
daemonset
department
deployment
environment
job
label
requires the following format: label:<label_name>
namespace
node
owner
pod
product
service
statefulset
team
chartDisplay
-- Can be one of category
, series
, efficiency
, percentage
, or treemap
. See Cost Allocation Charts for more info.
idle
idle cost allocation, supports hide
, shareByNode
, shareByCluster
, and separate
rate
-- Can be one of cumulative
, monthly
, daily
, hourly
accumulate
determines whether or not to sum Allocation costs across the entire window -- equivalent to Resolution in the UI, supports true
(Entire window resolution) and false
(Daily resolution)
sharedNamespaces
-- a list containing namespaces to share costs for.
sharedOverhead
-- an integer representing overhead costs to share.
sharedLabels
-- a list of labels to share costs for, requires the following format: label:<label_name>
filters
-- a list of maps consisting of a property and value
property
-- supports cluster
, node
, namespace
, and label
value
-- property value(s) to filter on, supports wildcard filtering with a *
suffix
Special case label
value
examples: app:cost-analyzer
, app:cost*
Wildcard filters only apply for the label value. e.g., ap*:cost-analyzer
is not valid
Note: multiple filter properties evaluate as ANDs, multiple filter values evaluate as ORs
e.g., (namespace=foo,bar), (node=fizz) evaluates as (namespace == foo || namespace == bar) && node=fizz
Important: If no filters used, supply an empty list []
When defining reports via values.yaml, by setting global.savedReports.enabled = true
in the values file, the reports defined in values.yaml are created when the Kubecost pod starts. Reports can still be freely created/deleted via the UI while the pod is running. However, when the pod restarts, whatever is defined the values file supersedes any UI changes.
Generally, the ConfigMap, if present, serves as the source of truth at startup.
If saved reports are not provided via values.yaml, meaning global.savedReports.enabled = false
, reports created via the UI are saved to a persistent volume and persist across pod restarts.
Review these steps to verify that saved reports are being passed to the Kubecost application correctly:
Confirm that global.savedReports.enabled
is set to true
Ensure that the Helm values are successfully read into the ConfigMap
Run helm template ./cost-analyzer -n kubecost > test-saved-reports-config.yaml
Open test-saved-reports-config
Find the section starting with # Source: cost-analyzer/templates/cost-analyzer-saved-reports-configmap.yaml
Ensure that the Helm values are successfully read into the ConfigMap under the data
field. Example below.
3. Ensure that the JSON string is successfully mapped to the appropriate configs
Navigate to your Reports page in the Kubecost UI and ensure that the configured report parameters have been set by selecting the Report name.
Cost Center Report is a beta feature. Please share your feedback as we are in active development of this feature.
A Cost Center Report (CCR) allows you to join your Kubernetes resource costs with cloud-native services. For example, it allows combining S3 and/or BigQuery costs with the Kubernetes namespace that is consuming those services.
The reporting supports multiple types of resource matches in terms of labels/tags/accounts/K8s object names/etc.
Begin by selecting Reports in the left navigation. Then, select Create a report > Advanced Report - Cost Centers. The Cost Center Report page opens.
In the Report name field, enter a custom value name for your report. This name will appear on your Reports page for quick access after creation.
In the Cost center name field, enter the desired name for your Cost Center. Once a Report name and Cost center name have been provided, it should appear at the bottom of the page in the Report Preview. However, continue with this section to learn how to customize your Cost Center Report and complete its creation.
You can aggregate your cloud costs by a variety of fields (default is Service). Single and multi-aggregation, and custom labels, are supported. Then, select the desired cloud cost metric. Cloud cost metrics are calculated differently depending on your cloud service provider (CSP).
Certain selected cloud cost metrics may produce errors forming your report preview. Use Net Amortized Cost, the default option, if you experience this error.
You can also provide custom filters to display only resources which match the filter value in your Cost Center Report. Select Filter and choose a filter type from the dropdown, then provide your filter value in the text field. Select the plus sign icon to add your filter.
Your Kubernetes workload data can be read as your Kubernetes allocations. You can aggregate and filter for your allocation data in the same way as your cloud cost data as described above. Default aggregation is Namespace.
Your cost center should automatically appear in the Report Preview. There is no need to finalize its creation; it will exist as long as all required fields have been provided. The Report Preview provides cost data for each cost center.
After configuring a cost center, you can select Collapse to close that configuration (this is only to condense the page view, it will not affect your overall reported data).
Any cloud provider tag or label can be used, but be sure to follow the Cloud Billing Integrations guide for any respective CSPs to ensure that they are included with the billing data.
when using tags and labels, separate the key and value with a :
. Example: owner:frontend
.
A single CCR allows for the creation of multiple cost centers within it. To create an additional cost center, select Add cost center. This will open a new cost center tab and the functionality of creating a cost center will be the same.
You can delete a cost center by selecting Delete Cost Center in its tab, or selecting the trash can icon in the line of that cost center in the Report Preview.
When you are finished adding or deleting cost centers, select Done to finalize your CCR. You will be taken to a page for your reports. You can select individual cost centers for breakdowns of cloud costs and Kubernetes costs.
A cost center name is required in order for your cost center to appear in the Report Preview. However, if you select Done without giving a name to a cost center, it will appear in your Report with a blank space for a name. It can still be interacted with, but it is recommended to name all cost centers.
The Cost column per line item is the total cost of all other columns.
You can also adjust the window of spend data by selecting the Time window box and choosing either a preset or entering a custom range.
When viewing a breakdown of your cloud costs, you may see the same aggregate repeated multiple times. These are of the same property across multiple different days. When you expand the window range, you should naturally see the number of line items increase.
If you return to the Reports page, you will now see your CCR displayed amongst your other reports. Selecting the three horizontal dots in the Actions column of your CCR will allow you to Edit or Delete the CCR.