FlexReports give you a flexible way to analyze data in your bill on-demand and across any variable. They offer the following benefits:
Note- Effective December 15, 2023, Google Cloud product names and SKU descriptions changed from
egress
oringress
todata transfer
. The new names will include modifying terms such asoutbound
orout
andinbound
orin
. Since Tanzu CloudHealth FlexReport is receiving GCP data from original bills, the Sku Descriptions in the FlexReport GCP data sources have been automatically updated from December 15, 2023 onwards.
- Adding a greater number of Perspectives in FlexReports is currently available for the AWS Cost and Usage Report dataset. The feature will be available for the datasets of other cloud platforms over time.
Cost-based interactive reports such as the Cost History report and FlexReports sometimes differ depending on the dimensions used due to how your data is prepared for these reports. This leads to differences in how the reports are generated, how Perspectives are included, and which dimensions are available to you. For more information, see Tanzu CloudHealth Knowledge Base article.
The data sources for FlexReports are Amazon Cost and Usage Report (CUR), Azure Enterprise Agreement (EA), GCP BigQuery Billing Export, Alibaba Cloud Bill, Kubernetes Containers Usage, and Kubernetes Nodes Usage. You can also use AWS, Azure, and GCP cost anomaly data in FlexReports.
NoteFlexReport supports 13 months of historical data.
You can use platform-provided templates to configure new FlexReports. These templates have pre-configured settings to generate specific reports, and you can create new custom reports using the template as a base.
To use a FlexReport template:
You can edit your FlexReport at any time by opening the FlexReport and selecting Edit Report.
The following options can be defined when creating a custom FlexReport:
Periods and whitespaces in perspective names are not supported and are removed from the displayed report dimension.
After you delete or rename any perspective, the corresponding saved FlexReport will fail. Update the failed report by removing the Perspective from the saved report.
The report preview section provides a glimpse of what the report structure looks like based on the selections in the report configuration section. Use the report preview to confirm that your report is set up correctly.
- If you create or modify a report query, include aliases in all the selected columns. For example: SELECT
timeInterval_Month
ASMonth
. This is applicable to all the existing reports as well as new reports. The custom queries for all the existing reports with subscriptions, default Measures and Dimensions are already modified to include aliases. If you have not included aliases in your query, the report displays an error.- An alias cannot contain any special character except the underscore (_).
Subscribe to FlexReports to receive regular reports by email or have the report delivered to an S3 bucket. To subscribe to a FlexReport:
When using and naming resource tags, consider the following:
Use charts to visualize your FlexReport data without exporting it to a CSV file.
On the FlexReport > Chart View page, you can change the Chart type, X/Y axis and Category fields and edit the Filters. You can also drill down to get a more detailed and granular view of the data.
FlexReports visualization offers you the following benefits:
FlexReport supports 13 months of historical data.
While editing or creating a new FlexReport, configure the following chart parameters under the Chart Preview section:
Note: In certain custom SQL scenarios where dimension and measure cannot be differentiated, select an appropriate value for the chart coordinates.
The following is a Chart preview example of a FlexReport configured with the following parameters:
Category: None
You can overlay more details on the chart by selecting a Category. For instance, a Perspective based on owners (Perspective.Owner).
The Chart preview is not representative of the entire dataset and considers only data of up to 100 rows from the complete generated report. Once you save and run the report, the FlexReport displays complete data.
After you create a chart for a FlexReport, you can view the chart in the report by clicking the report name at Reports > FlexReports.
The timestamp below the Report name displays the date and time when the report was last run.
The table below the chart displays the aggregated data for all corresponding columns of the applied filter. Click Show all columns checkbox to view all the data columns from the report. Use the search option on the top-right of the table to filter specific data across all columns.
You can further sort any column or apply filters to this data table.
Drilling down into your FlexReport displays only the first 100 rows from the report, which will be increased incrementally. However, filter or sort report data is performed on the entire dataset, not just on 100 rows. This is also applicable to the report tabular view below the chart.
Click Filters to view the selected dimension and measures for the chart coordinates. Click Show All to view all the available dimensions and measures. You can then select and apply any of these as coordinates for the chart.
Dual Y-Axis allows data from different datasets to be visualized together. It illustrates correlations between two different datasets with different magnitudes and helps interpret data more easily.
As shown in the following report example, each dataset has a separate axis.
In this example, SUM_lineitem_UnblendedCost
is represented by Chart type, and SUM_lineitem_Unblendedrate
and SUM_pricing_publicOnDemandCost
is represented by Chart type dual y-axis.
The FlexReport chart view displays data based on the last time the report was run. Switching to the Live mode, you can view the report with the latest data available. Live mode does not update or save the report, it only refreshes it with the current data. You can change the available chart parameters or filters, but you may experience a slower response than running an already configured report.
To enable Live mode, select the toggle at the top-right corner of the FlexReport > Chart View page.
To share a link to your report, open the FlexReport and click Share.
You can share a chart view with limited data by filtering the legends. After selecting or deselecting the legends, the share link displays data only for the selected legends.
By default, a user in the Administrator or Power User role can create, read, update, and delete FlexReports. This user can be a part of any organization unit. Refer to Anatomy of Organizational Hierarchy for complete information on organizational hierarchy for FlexOrgs.
By default, users in the Standard role can only view the reports. However, you can create a custom role with all the FlexReport privileges.
To select FlexReports permissions, navigate to Setup > Admin > Roles. In the Privileges section of the role editor, expand FlexReports and enable or disable the required permissions.
FlexReports are only visible to an user assigned to a role with read
privileges for FlexReports. If an unauthorized user attempts to access FlexReports, the following error message is displayed: User is not authorized to perform this action, insufficient Role Privileges for FlexReports
Using FlexReport Dataset level permissions (granular permissions), you can provide separate access within your team and grant users only the amount of access they need to perform actions on respective FlexReport datasets. Currently, these granular permissions are available for AWS Cost & Usage Report, Azure Enterprise Agreement, GCP BigQuery Billing Export, Alibaba Cloud Bill, and FlexReport datasets are supported by FlexOrgs to ensure the right access for the right users.
To select granular permissions, navigate to Setup > Admin > Roles. In the Privileges section of the role editor, expand FlexReports > Data Sources and enable or disable the required permissions.
You can also assign the granular permissions using the GraphQL APIs. For more information, see the createRoleDocument API.
You can use the following clauses and conditional aggregation to customize a query in the FlexReport query editor.
Note
SELECT
statements.AS
is mandatory to use.SELECT
Measures (Aggregated or not) and DimensionsGROUP BY
for Dimensions (Required when Measures are aggregated and any Dimensions are selected)
GROUPING SET
is also supported for **Dimensions with GROUP BYORDER BY
for both Dimensions and MeasuresWHERE
for applying FiltersWITH
for defining a temporary relation
cxtemp_
, but they can reference a different DataSource.UNION
and UNION ALL
for union of several Select StatementsFlexReport supports the following SQL functions and Analytical Expressions in the SELECT
, GROUP BY
, ORDER BY
and WHERE
clauses.
SELECT count(*) AS count
FROM AWS_CUR
WHERE resourcetags_user_env = 'dev'
SELECT sum(lineItem_UnblendedCost) AS cost
FROM AWS_CUR
WHERE resourcetags_user_env = 'dev'
SELECT min(lineItem / UnblendedCost) AS minCost
FROM AWS_CUR
WHERE resourcetags_user_env = 'dev'
SELECT max(lineItem / UnblendedCost) AS maxCost
FROM AWS_CUR
WHERE resourcetags_user_env = 'dev'
SELECT avg(lineItem / UnblendedCost) AS cost
FROM AWS_CUR
WHERE resourcetags_user_env = 'dev'
SELECT timeInterval_Day AS Day
,SUM(edp_NetUnblendedCost) AS SUM_edp_NetUnblendedCost
,LOWER(product_operatingSystem) AS Product_operatingSystem
FROM AWS_CUR
GROUP BY timeInterval_Day
,LOWER(product_operatingSystem)
SELECT timeInterval_Month AS Month
,SUM(lineItem_UnblendedCost) AS \ "SUM(lineItem_UnblendedCost)\"
,LAG(SUM(lineItem_UnblendedCost), 1) OVER (
PARTITION BY lineItem_ResourceId ORDER BY timeInterval_Month
) AS Prev_Month_Cost
,SUM(lineItem_UnblendedCost) - LAG(SUM(lineItem_UnblendedCost), 1) OVER (
PARTITION BY lineItem_ResourceId ORDER BY timeInterval_Month
) AS Delta_Cost
,bill_PayerAccountId AS Bill_PayerAccountId
,lineItem_ResourceId AS LineItem_ResourceId
FROM AWS_CUR
WHERE (lineItem_ResourceId LIKE '%cht%')
GROUP BY timeInterval_Month
,bill_PayerAccountId
,lineItem_ResourceId
ORDER BY timeInterval_Month DESC
,lineItem_ResourceId DESC
Only up to 2 parameters are supported. Use nested CONCAT instead.
SELECT timeInterval_Month AS Month
,SUM(reservation_AmortizedUpfrontCostForUsage) AS \ "SUM(reservation_AmortizedUpfrontCostForUsage)\"
,bill_PayerAccountId AS Bill_PayerAccountId
,lineItem_LineItemDescription AS LineItem_LineItemDescription
,lineItem_UsageAccountId AS LineItem_UsageAccountId
,product_ProductName AS Product_ProductName
,reservation_ReservationARN AS Reservation_ReservationARN
FROM AWS_CUR
WHERE (lineItem_LineItemDescription ILIKE '%reserved instance applied%')
AND (product_ProductName IN ('Amazon Elastic Compute Cloud'))
AND (
reservation_ReservationARN NOT LIKE CONCAT (
'%'
,CONCAT (
lineItem_UsageAccountId
,'%'
)
)
)
GROUP BY timeInterval_Month
,bill_PayerAccountId
,lineItem_LineItemDescription
,lineItem_UsageAccountId
,product_ProductName
,reservation_ReservationARN
Only up to 2 parameters are supported.
SELECT timeInterval_Month AS TimeInterval_Month
,ROUND(SUM(lineItem_UnblendedCost), 0) AS \ "ROUND(SUM(lineItem_UnblendedCost))\"
,SUM(lineItem_UnblendedRate) AS \ "SUM(lineItem_UnblendedRate)\"
,resourceTags_user AS resourceTags_user
FROM AWS_CUR
WHERE resourceTags_user AS resourceTags_user LIKE '%CloudHealthUser%' )
GROUP BY timeInterval_Month
,resourceTags_user
ORDER BY timeInterval_Month ASC
SELECT COALESCE(product_productFamily, product_ProductName) AS product
FROM AWS_CUR
SELECT trim(product_ProductName) AS product
FROM AWS_CUR
SELECT timeInterval_Month AS Month
,bill_BillingPeriodStartDate AS Bill_BillingPeriodStartDate
,DATE (FROM_ISO8601_TIMESTAMP(bill_BillingPeriodStartDate)) AS Formatted_BillingPeriodStartDate
,bill_BillingPeriodEndDate AS Bill_BillingPeriodEndDate
,DATE (FROM_ISO8601_TIMESTAMP(bill_BillingPeriodEndDate)) AS Formatted_BillingPeriodEndDate
FROM AWS_CUR
SELECT DATE_DIFF('hour', FROM_ISO8601_TIMESTAMP(bill_BillingPeriodStartDate), FROM_ISO8601_TIMESTAMP(bill_BillingPeriodEndDate)) AS BillingPeriodHourDiff
,timeInterval_Day AS Day
,SUM(edp_NetUnblendedCost) AS SUM_edp_NetUnblendedCost
FROM AWS_CUR
GROUP BY timeInterval_Day
,DATE_DIFF('hour', FROM_ISO8601_TIMESTAMP(bill_BillingPeriodStartDate), FROM_ISO8601_TIMESTAMP(bill_BillingPeriodEndDate))
SELECT lineItem_ResourceId AS \ "S3 Bucket\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%StandardStorage%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "Standard Storeage Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%StandardStorage%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "Standard Storage Usage\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GetObject%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "GetObject Usage\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GetObject%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "GetObject Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%PutObject%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "PutObject Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%PutObject%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "PutObject Usage\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GlacierStorage%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "GlacierStorage Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GlacierStorage%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "GlacierStorage Usage\"
FROM AWS_CUR
WHERE (lineItem_ProductCode LIKE '%AmazonS3%')
AND (lineItem_ResourceId IS NOT NULL)
GROUP BY lineItem_ResourceId
SELECT lineItem_ResourceId AS \ "S3 Bucket\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%StandardStorage%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "Standard Storeage Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%StandardStorage%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "Standard Storage Usage\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GetObject%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "GetObject Usage\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GetObject%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "GetObject Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%PutObject%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "PutObject Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%PutObject%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "PutObject Usage\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GlacierStorage%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "GlacierStorage Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GlacierStorage%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "GlacierStorage Usage\"
FROM AWS_CUR
WHERE (lineItem_ProductCode LIKE '%AmazonS3%')
AND (lineItem_ResourceId IS NOT NULL)
GROUP BY lineItem_ResourceId
ELEMENT_AT
SELECT timeInterval_Day AS Day
,SUM(CostInUsd) AS SUM_CostInUsd
,ELEMENT_AT(azure_AdditionalInfo_Map, 'resourcecategory') AS azure_AdditionalInfo_Map_resourcecategory
FROM AZURE_COST_USAGE
GROUP BY timeInterval_Day
,ELEMENT_AT(azure_AdditionalInfo_Map, 'resourcecategory')
MAP_KEYS
SELECT DISTINCT tags_map.mapfields AS tag_keys
FROM GCP_BILLING_EXPORT
CROSS JOIN UNNEST(map_keys(gcp_Labels_Map)) AS tags_map(mapfields)
WHERE tags_map.mapfields LIKE '%env%'
MAP_VALUES
SELECT DISTINCT tags_map.mapfields AS map_values
FROM GCP_BILLING_EXPORT
CROSS JOIN UNNEST(map_values(gcp_Labels_Map)) AS tags_map(mapfields)
WHERE tags_map.mapfields LIKE '%prod%'
SELECT lineitem / resourceid
,lineItem / UnblendedCost AS cost
FROM AWS_CUR
WHERE resourcetags_
SELECT timeInterval_Month AS Month
,SUM(lineItem_UnblendedCost) AS \ "SUM(lineItem_UnblendedCost)\"
,LAG(SUM(lineItem_UnblendedCost), 1) OVER (
PARTITION BY lineItem_ResourceId ORDER BY timeInterval_Month
) AS Prev_Month_Cost
,SUM(lineItem_UnblendedCost) - LAG(SUM(lineItem_UnblendedCost), 1) OVER (
PARTITION BY lineItem_ResourceId ORDER BY timeInterval_Month
) AS Delta_Cost
,bill_PayerAccountId AS Bill_PayerAccountId
,lineItem_ResourceId AS LineItem_ResourceId
FROM AWS_CUR
WHERE (lineItem_ResourceId LIKE '%cht%')
GROUP BY timeInterval_Month
,bill_PayerAccountId
,lineItem_ResourceId
ORDER BY timeInterval_Month DESC
,lineItem_ResourceId DESC
SELECT timeInterval_Month AS Month
,bill_BillingPeriodStartDate AS Bill_BillingPeriodStartDate
,DATE (FROM_ISO8601_TIMESTAMP(bill_BillingPeriodStartDate)) AS Formatted_BillingPeriodStartDate
,bill_BillingPeriodEndDate AS Bill_BillingPeriodEndDate
,DATE (FROM_ISO8601_TIMESTAMP(bill_BillingPeriodEndDate)) AS Formatted_BillingPeriodEndDate
FROM AWS_CUR
LIKE / NOT LIKE
ILIKE / NOT ILIKE
IN / NOT IN
IS NULL / IS NOT NULL
<
>
<=
>=
==
Conditional Aggregation are functions that compute a result set based on a given set of conditions.
SUM(CASE
WHEN )
,COUNT(CASE
WHEN )
)
)
SELECT lineItem_ResourceId AS \ "S3 Bucket\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%StandardStorage%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "Standard Storeage Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%StandardStorage%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "Standard Storage Usage\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GetObject%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "GetObject Usage\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GetObject%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "GetObject Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%PutObject%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "PutObject Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%PutObject%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "PutObject Usage\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GlacierStorage%'
THEN cast(lineItem_UnblendedCost AS DECIMAL(18, 3))
END) AS \ "GlacierStorage Cost\"
,SUM(CASE
WHEN lineItem_Operation LIKE '%GlacierStorage%'
THEN cast(lineItem_UsageAmount AS DECIMAL(18, 3))
END) AS \ "GlacierStorage Usage\"
FROM AWS_CUR
WHERE (lineItem_ProductCode LIKE '%AmazonS3%')
AND (lineItem_ResourceId IS NOT NULL)
GROUP BY lineItem_ResourceId
SELECT lineItem_ResourceId AS ResourceId
,split_part(lineItem_ResourceId, ':', 6) AS "SQS Queue Name"
,SUM(lineItem_UnblendedCost) AS "SUM(lineItem_UnblendedCost)"
FROM AWS_CUR
WHERE (product_ProductName LIKE '%Amazon Simple Queue Service%')
GROUP BY product_productFamily
,lineItem_ResourceId
,split_part(lineItem_ResourceId, ':', 6)
ORDER BY SUM(lineItem_UnblendedCost) DESC
The following are a few examples of using the supported SQL functions in FlexReport query editor.
SUM
for Measures in the SELECT
clause, with Filters
using IN
, NOT IN
and >=
and the use of ORDER BY
SELECT timeInterval_Month AS Month
,SUM(lineItem_UnblendedCost) AS \ "SUM(lineItem_UnblendedCost)\"
,product_region AS Product_region
,product_ProductName AS Product_ProductName
FROM AWS_CUR
WHERE (lineItem_UnblendedCost >= 10)
AND (
(product_region IN ('us-east-1'))
AND (product_region NOT IN ('us-west-1'))
)
GROUP BY timeInterval_Month
,product_region
,product_ProductName
ORDER BY timeInterval_Month DESC
WITH
clause to create a temporary table and used by the query that is associated with the WITH
clauseWITH cxtemp_temp
AS (
SELECT product_ProductName AS prod_name
FROM AWS_CUR
WHERE product_ProductName IN ('Amazon Elastic Compute Cloud')
)
SELECT timeInterval_Month AS Month
,cxtemp_temp.prod_name
,SUM(reservation_AmortizedUpfrontCostForUsage) AS cost
,bill_PayerAccountId AS Bill_PayerAccountId
,lineItem_LineItemDescription AS LineItem_LineItemDescription
,lineItem_UsageAccountId AS LineItem_UsageAccountId
,reservation_ReservationARN AS Reservation_ReservationARN
FROM AWS_CUR
RIGHT JOIN cxtemp_temp ON cxtemp_temp.prod_name = product_ProductName
WHERE (lineItem_LineItemDescription LIKE '%reserved instance applied%')
AND (
reservation_ReservationARN NOT LIKE CONCAT (
'%'
,CONCAT (
lineItem_UsageAccountId
,'%'
)
)
)
GROUP BY timeInterval_Month
,bill_PayerAccountId
,lineItem_LineItemDescription
,lineItem_UsageAccountId
,cxtemp_temp.prod_name
,reservation_ReservationARN
UNION
to create a Multi-Cloud FlexReportWITH \ "cxtemp_aws\"
AS (
SELECT 'AWS' AS Cloud
,timeInterval_Month AS Month
,SUM(lineItem_UnblendedCost) AS Cost
,product_ProductName AS Service
FROM AWS_CUR
GROUP BY timeInterval_Month
,product_ProductName
)
,\ "cxtemp_azure\"
AS (
SELECT 'Azure' AS Cloud
,timeInterval_Month AS Month
,SUM(CostInBillingCurrency) AS Cost
,ProductName AS Service
FROM AZURE_COST_USAGE
GROUP BY timeInterval_Month
,ProductName
)
,\ "cxtemp_gcp\"
AS (
SELECT 'GCP' AS Cloud
,timeInterval_Month AS Month
,SUM(Total_Cost) AS Cost
,Service_Description AS Service
FROM GCP_BILLING_EXPORT
GROUP BY timeInterval_Month
,Service_Description
)
SELECT Cloud
,Month
,Cost
,Service
FROM cxtemp_aws
UNION ALL
SELECT Cloud
,Month
,Cost
,Service
FROM cxtemp_azure
UNION ALL
SELECT Cloud
,Month
,Cost
,Service
FROM cxtemp_gcp
ORDER BY Service ASC`
To use Azure Cost Management dataset in FlexReport, ensure that you have configured the Azure Enterprise Agreement (EA) in Azure portal and the Enrollment reader role in the CloudHealth portal. For more details, see Configuring an Enterprise Agreement Azure Account.
Azure Cost Management dataset supports the following Azure agreements.
Using the following query, you can extract the raw cost for any supported Azure agreement type.
{
"sqlStatement": "SELECT timeInterval_Month AS Month, SUM(CostInReportingCurrency) AS SUM_CostInReportingCurrency, AccountType AS AccountType, MetricType AS MetricType FROM AZURE_COST_USAGE GROUP BY timeInterval_Month, AccountType, MetricType",
"needBackLinkingForTags": true,
"dataGranularity": "MONTHLY",
"timeRange": {
"last": 1,
"excludeCurrent": false
},
"limit": -1
}
For example, if you want to see cost data of current month and last month, you can create a FlexReport using the following measure and dimensions.
Measure- CostInReportingCurrency
– Cost calculated in reporting currency for the Azure agreement type.
Dimensions- MetricType
-Indicates whether the Azure cost displayed is Actual or Amortized, AccountType
- Indicates the Azure agreement respective cost belongs to.
- The Azure Cost Management dataset supports 13 months of cost data for all the supported Azure bill types in the dataset.
- To view Savings plans cost data, select
benefitId
andbenefitName
, under Account dimension.
Pre-requisites
Ensure you have a working cluster with active reporting status and Tanzu CloudHealth is gathering metrics on your environment. For more information on how to deploy Tanzu CloudHealth collector, see Getting Started with Kubernetes in Tanzu CloudHealth.
Kubernetes Usage Management supports the below datasets:
To Get Hourly Container Usage
On the FlexReport > New Report page, change the Datasource to Kubernetes Containers Usage. Expand the Report Query section and click Edit. Update the query in the query editor and click Apply.
{
"sqlStatement": "SELECT timeInterval_Hour AS Hour, timeInterval_Day AS Day, TimeInterval_Month AS Month, ClusterName as Cluster_Name, ContainerImage as Container_Image, ContainerName as Container_Name, AssetId as asset_id, AssetTypeId as asset_type_id, WorkloadName as Workload_Name, WorkloadType as Workload_Type, NamespaceName as Namespace_Name, CloudProviderId as Cloud_Provider_ID, CloudAccountId as Cloud_Account_ID, SUM(SumOfCpuResourcesRequested) AS CPU_Requests, SUM(SumOfCpuResourcesLimits) AS CPU_Limits, SUM(SumOfAverageCpuUsed) AS CPU_Usage_Average, SUM(SumOfMaxCpuUsed) AS CPU_Usage_Max, SUM(SumOfMinCpuUsed) AS CPU_Usage_Min, SUM(SumOfMemoryResourcesRequested) AS Memory_Requests_GB, SUM(SumOfMemoryResourcesLimits) AS Memory_Limits_GB, SUM(SumOfAverageMemoryUsed) AS Memory_Usage_Average_GB, SUM(SumOfMaxMemoryUsed) AS Memory_Usage_Max_GB, SUM(SumOfMinMemoryUsed) AS Memory_Usage_Min_GB FROM K8S_CONTAINERS_USAGE GROUP BY timeInterval_Hour, timeInterval_Day, timeInterval_Month, ClusterName, AssetId, AssetTypeId, ContainerImage, ContainerName, WorkloadName, WorkloadType, NamespaceName, CloudProviderId, CloudAccountId",
"needBackLinkingForTags": false,
"dataGranularity": "HOURLY",
"timeRange": {
"last": 192,
"excludeCurrent": false
},
"limit": -1
}
To Get Hourly Node Usage
On the FlexReport > New Report page, change the Datasource to Kubernetes Nodes Usage. Expand the Report Query section and click Edit. Update the query in the query editor and click Apply.
{
"sqlStatement": "SELECT timeInterval_Hour AS Hour, timeInterval_Day AS Day, TimeInterval_Month AS Month, ClusterName as Cluster_Name, NodeName as Node_Name, AssetId as asset_id, AssetTypeId as asset_type_id, CloudProviderId as Cloud_Provider_ID, CloudAccountId as Cloud_Account_ID, SUM(AllocatableCpu) AS CPU_Allocatable, SUM(Allocatablememory) AS Memory_Allocatable_GB, SUM(SumOfCpuResourcesRequested) AS CPU_Requests, SUM(SumOfCpuResourcesLimits) AS CPU_Limits, SUM(SumOfAverageCpuUsed) AS CPU_Usage_Average, SUM(SumOfMaxCpuUsed) AS CPU_Usage_Max, SUM(SumOfMinCpuUsed) AS CPU_Usage_Min, SUM(SumOfMemoryResourcesRequested) AS Memory_Requests_GB, SUM(SumOfMemoryResourcesLimits) AS Memory_Limits_GB, SUM(SumOfAverageMemoryUsed) AS Memory_Usage_Average_GB, SUM(SumOfMaxMemoryUsed) AS Memory_Usage_Max_GB, SUM(SumOfMinMemoryUsed) AS Memory_Usage_Min_GB FROM K8S_NODES_USAGE GROUP BY timeInterval_Hour, timeInterval_Day,timeInterval_Month, AssetId, AssetTypeId, ClusterName, NodeName, CloudProviderId, CloudAccountId",
"needBackLinkingForTags": false,
"dataGranularity": "HOURLY",
"timeRange": {
"last": 192,
"excludeCurrent": false
},
"limit": -1
}
This topic will show you how to use FlexReports to compare the GCP dataset with the GCP cost history.
The following are the filter recommendations for a query that compares FlexReports GCP dataset with the GCP Cost History v2 at the billing account level:
Cost_Type LIKE '%regular%'
Project_Id IS NOT NULL
{
"sqlStatement": "SELECT timeInterval_Month AS Month, SUM(Cost) AS \"SUM(Cost)\", Billing_Account_Id AS Billing_Account_Id FROM GCP_BILLING_EXPORT WHERE (Cost_Type LIKE '%regular%') AND (Project_Id IS NOT NULL) GROUP BY timeInterval_Month, Billing_Account_Id",
"dataGranularity": "MONTHLY",
"needBackLinkingForTags": false,
"timeRange": {
"from": "2021-04",
"to": "2021-05"
}
}
GCP corrects the cost of the line items which could cause Cost_Type
to have a rounding error. To address the rounding error, the query includes the Cost_Type
filter set to %regular%
.
In FlexReports, the cost associated with line items that have the project_id
as null is already handled. However, these line items are not deleted from the dataset. To view the Total Reallocated Cost, use the gcp/project_id IS NOT NULL
filter. With this, the additional line items in the FlexReports dataset will not be considered.
Use the Multi-Cloud Operational Emissions dataset to view carbon footprint details of your infrastructure usage. The dataset provides per instance, daily granularity data to power your GreenOps experiences.
To enable the Multi-Cloud Operational Emissions dataset for a specific role, navigate to Setup >Admin >Role Documents. Click the vertical ellipsis next to the role name, and click Edit. From the left menu, click FlexReports > Data Sources, and select the MultiCloud Operational Emissions check box.
NoteSustainability data will be available starting from the GreenOps feature onboarding date. The Multi-Cloud Operational Emissions dataset will include only forward-looking data.
You can create a report using the following measures and dimensions.
Measures
Name | Description |
---|---|
AverageCPU | Daily Average CPU utilization |
Carbon | Carbon Equivalent emissions in grams (gCO2eq). Note this might need to be scaled into kilograms ( div 1000) or metric tons ( div 1,000,000) for display purposes. |
Power | Power in Watt Hours. This may also need to be scaled to KiloWatts ( div 1000) or MegaWatts (div 1,000,000). |
Usage Minutes | The total daily minutes the resource was active. |
VCPUHours | Scaled Usage Hours. For example, an instance has 4 vCPUs and is active for 2.5 hours = (4 * 2.5 = 10 VCPUHours). |
Dimensions
Name | Description |
---|---|
Cloud | AWS, Azure |
Country | Country where resource resides |
InstanceType | Cloud provider’s instance type |
ModelVersion | Tanzu CloudHealth algorithm version number. For example -CHT001. The number might get updated in the future if there is any change in the algorithm. |
Region | The region where the resource resides |
ResourceId | Canonical resource id |
ResourceName | Friendly name for Azure instance, Resource Id for AWS instance |
Service | Amazon EC2 or Azure Virtual Machines |
UsageAccountId | Usage account or Subscription ID. The lowest level in the organizational hierarchy is where the resource is homed. |
AccountName | Friendly name for UsageAccount |
SuborgId | Tanzu CloudHealth Organization Id |
Suborgname | Tanzu CloudHealth Organization Name |
Perspective | List of perspectives |
For the Azure cloud, only Enterprise Agreement (EA) and Azure Microsoft Customer Agreement (MCA) data are available in the Multi-Cloud Operational Emissions dataset.
For more information, see GreenOps Dashboard.
The CloudHealth Consumption Breakdown is a multicloud dataset in FlexReport that helps you to generate CloudHealth usage reports for Tanzu CloudHealth’s Direct and Partner customers. The report provides a breakdown of spend by cloud providers that can be used for CloudHealth invoice reconciliation. This report shows the total monthly cloud usage cost in US dollars for each customer per Cost Type.
For cost accuracy, the Tanzu CloudHealth considers the following factors when calculating the cloud usage -
For the Partner and Direct customers -
For a detailed breakdown of the Cost Types included on each measure within the Consumption Breakdown Dataset, please refer to the following section Applicable Cost Types for Consumption Breakdown Dataset Measures.
Customer Type | CloudHealth Consumption Breakdown Dataset Measure | Cost Types (As seen in the FlexReport) |
---|---|---|
Partner | ExcludedUsage | marketplace tax vmware_cloud_on_aws vmware_cloud_on_aws_prepay billing_rule Invoice_tax invoice_billingadjustment Invoice_roundingerror |
Partner | Usage | total |
Channel customer | ChannelBillableUsage | total |
Channel customer | ConfiguredUsageAtPartner | total |
Channel customer | ExcludedChannelBillableUsage | marketplace tax vmware_cloud_on_aws vmware_cloud_on_aws_prepay billing_rule invoice_tax invoice_billingadjustment invoice_roundingerror |
Channel customer | ExcludedConfiguredUsageAtPartner | marketplace tax vmware_cloud_on_aws vmware_cloud_on_aws_prepay billing_rule invoice_tax invoice_billingadjustment invoice_roundingerror |
Direct customer | ExcludedUsage | marketplace tax vmware_cloud_on_aws vmware_cloud_on_aws_prepay neptune_ri_prepay dynamo_db_ri_prepay_read dynamo_db_ri_prepay_write ec2_ri_prepay elastic_cache_rn_prepay elasticsearch_ri_prepay rds_ri_prepay redshift_rn_prepay savings_plan_upfront_fee sm_savings_plan_upfront_fee amortized_marketplace amortized_tax amortized_vmware_cloud_on_aws amortized_vmware_cloud_on_aws_prepay amortized_neptune_ri_prepay amortized_dynamo_db_ri_prepay_read amortized_dynamo_db_ri_prepay_write amortized_ec2_ri_prepay amortized_elastic_cache_rn_prepay amortized_elasticsearch_ri_prepay amortized_rds_ri_prepay amortized_redshift_rn_prepay amortized_savings_plan_upfront_fee amortized_sm_savings_plan_upfront_fee billing_rule amortized_billing_rule invoice_tax invoice_billingadjustment invoice_roundingerror |
Direct customer | Usage | total sub_total full_amortized_cost |
Note that some Cost Types might not reflect in your FlexReport CloudHealth Consumption Breakdown Dataset because:
Usage is the consumption of a cloud-billable service or resources. The Tanzu CloudHealth tracks your usage, calculates the cost, and generates your invoice. The usage is always billed in arrears. The month in the FlexReport refers to when the Tanzu CloudHealth generates the invoice, not the month you used the resources. For example, the usage cost in your January invoice reflects your December usage. Therefore, to map your billing data in FlexReport, you must look for the previous month’s data in your archived Cost reports. For example, to map the January 2024 usage cost displayed in the FlexReport, you will need to check the December 2024 archived Cost report.
You also must apply appropriate Filters to ensure the usage cost in the archived report accurately reflects the usage cost you have seen in the FlexReport. For more information, see Key Selections in Archived Cost Report for Mapping FlexReport Usage Cost section.
To map the CloudHealth usage cost in the FlexReport and archived Cost Report,
Step 1 - Check the usage value attached to a Cost Type in the FlexReport.
The usage value of the selected Cost Type appears in the FlexReport Preview section.
Step 2 - Check the usage value of the Cost Type selected in Step 1 in the relevant archived Cost report.
The following table helps you map the FlexReport usage cost to the archived Cost report. It details the relevant archived Cost report for each Cost Type, the Y-axis measure you should select, and the specific Cost Type you should include or exclude from the Filters option.
Note that
CurrencyConversionRate
to match the Usage values you received in the FlexReport in USD. You can find the CurrencyConversionRate
as a dimension in the CloudHealth Consumption Breakdown dataset in the FlexReport.Cost Type | Cost Report | Y-Axis Measure | Filters > AWS Services > Include | Filters > AWS Services > Exclude |
---|---|---|---|---|
total | Cost > History | Cost | NA | Tax Amazon Marketplace VMware Cloud on AWS |
Usage_cost | Cost > History | Cost | NA | Neptune - RI Prepay DynamoDB - Reserved Prepay Read DynamoDB - Reserved Prepay Write EC2 - RI Prepay ElastiCache - Reserved Nodes Prepay OpenSearch - RI Prepay RDS - RI Prepay Redshift - Reserved Nodes Prepay VMware Cloud on AWS - Prepay Savings Plan - Upfront Fee SageMaker Savings Plan - Upfront Fee Upfront payments Tax Amazon Marketplace VMware Cloud on AWS |
full_amortized_cost | Cost > History | Amortized Cost | NA | Neptune - RI Prepay DynamoDB - Reserved Prepay Read DynamoDB - Reserved Prepay Write EC2 - RI Prepay ElastiCache - Reserved Nodes Prepay OpenSearch - RI Prepay RDS - RI Prepay Redshift - Reserved Nodes Prepay VMware Cloud on AWS - Prepay Savings Plan - Upfront Fee SageMaker Savings Plan - Upfront Fee Upfront payments Tax Amazon Marketplace VMware Cloud on AWS |
marketplace | Cost > History | Cost | Amazon Marketplace | NA |
tax | Cost > History | Cost | Tax | NA |
vmware_cloud_on_aws | Cost > History | Cost | VMware Cloud on AWS | NA |
vmware_cloud_on_aws_prepay | Cost > History | Cost | VMware Cloud on AWS - Prepay | NA |
aws_neptune_ri_prepay | Cost > History | Cost | Neptune - RI Prepay | NA |
dynamo_db_ri_prepay_read | Cost > History | Cost | DynamoDB - Reserved Prepay Read | NA |
dynamo_db_ri_prepay_write | Cost > History | Cost | DynamoDB - Reserved Prepay Write | NA |
ec2_ri_prepay | Cost > History | Cost | EC2 - RI Prepay | NA |
elastic_cache_rn_prepay | Cost > History | Cost | ElastiCache - Reserved Nodes Prepay | NA |
elasticsearch_ri_prepay | Cost > History | Cost | OpenSearch - RI Prepay | NA |
rds_ri_prepay | Cost > History | Cost | RDS - RI Prepay | NA |
savings_plan_upfront_fee | Cost > History | Cost | Savings Plan - Upfront Fee | NA |
sm_savings_plan_upfront_fee | Cost > History | Cost | SageMaker Savings Plan - Upfront Fee | NA |
amortized_marketplace | Cost > Amortization | Amortized Cost | Marketplace | NA |
amortized_tax | Cost > Amortization | Amortized Cost | Tax | NA |
amortized_vmware_cloud_on_aws | Cost > Amortization | Amortized Cost | VMware Cloud on AWS | NA |
amortized_vmware_cloud_on_aws_prepay | Cost > Amortization | Cost Amortized Cost |
VMware Cloud on AWS - Prepay | NA |
amortized_aws_neptune_ri_prepay | Cost > Amortization | Amortized Cost | AWS Services > Neptune - RI Prepay | NA |
amortized_dynamo_db_ri_prepay_read | Cost > Amortization | Amortized Cost | DynamoDB - Reserved Prepay Read | NA |
amortized_dynamo_db_ri_prepay_write | Cost > Amortization | Amortized Cost | DynamoDB - Reserved Prepay Write | NA |
amortized_ec2_ri_prepay | Cost > Amortization | Amortized Cost | EC2 - RI Prepay | NA |
amortized_elastic_cache_rn_prepay | Cost > Amortization | Amortized Cost | ElastiCache - Reserved Nodes Prepay | NA |
amortized_elasticsearch_ri_prepay | Cost > Amortization | Amortized Cost | OpenSearch - RI Prepay | NA |
amortized_rds_ri_prepay | Cost > Amortization | Amortized Cost | RDS - RI Prepay | NA |
amortized_redshift_rn_prepay | Cost > Amortization | Amortized Cost | Redshift - Reserved Nodes Prepay | NA |
amortized_savings_plan_upfront_fee | Cost > Amortization | Amortized Cost | Savings Plan - Upfront Fee | NA |
amortized_sm_savings_plan_upfront_fee | Cost > Amortization | Amortized Cost | SageMaker Savings Plan - Upfront Fee | NA |
Cost Type | Cost Report | Y-Axis Measure | Filters > Services > Include | Filter > Azure Services > Exclude |
---|---|---|---|---|
total | Cost > History Report | Total Cost | NA | Marketplace > Marketplace Billing rule |
billing_rule | Cost > History Report | Total Cost | Billing Rule | NA |
amortized_billing_rule | Cost > History Report | Amortized Cost | Billing Rule | NA |
Cost Type | Cost Report | Y-Axis Measure | Filter > Cloud Products > Include | Filters > Cloud Products > Exclude |
---|---|---|---|---|
total | Cost > History Invoice | Total Cost | NA | Invoice - Tax Invoice - BillingAdjustment Invoice - RoundingError |
invoice_tax | Cost > History Invoice | Total Cost | Invoice > Invoice - Tax | NA |
invoice_billingadjustment | Cost > History Invoice | Total Cost | Invoice > Invoice - BillingAdjustment | NA |
invoice_roundingerror | Cost > History Invoice | Total Cost | Invoice > Invoice - RoundingError | NA |
Cost Type | Cost Report | Y-Axis Measure | Filters > Services > Include | Filters > Services > Exclude |
---|---|---|---|---|
total | Cost > History Report | Cost | NA | Tax Marketplace |
Cost Type | Cost Report | Y-Axis Measure | Filters > Product Name > Include | Filters > Product Name > Exclude |
---|---|---|---|---|
total | Cost > History Report | Pretax Amount | NA | Tax Marketplace |
The CloudHealth usage values in a cost report may not match with the values in the FlexReport CloudHealth Consumption Breakdown Dataset value in the following situations -
Tanzu CloudHealth Partners and Direct customers can use the CloudHealth Customer Usage Report template to view the total usage cost for the past two months. This cost is used to invoice Partners and Direct customers. The template is available under FlexReport > View Templates.
For instructions on creating a custom FlexReport using a template, see the FlexReport Templates section.