GCP Cost History when categorized using "Product Categories" does not match with FlexReport Service_Description
search cancel

GCP Cost History when categorized using "Product Categories" does not match with FlexReport Service_Description

book

Article ID: 386241

calendar_today

Updated On:

Products

CloudHealth

Issue/Introduction

Product Category is derived based on sku.description field in Big Query.
However, there is not a 1:1 mapping between Product Category in CloudHealth and sku.description in GCP.
It is customized manually to group multiple SKUs together in a single logical category

Resolution

Service_Description in GCP FlexReport can be matched with cloud products in Cost History using below query.

Flexreport query:

{
  "sqlStatement": "SELECT timeInterval_Month AS Month, SUM(Cost) AS Cost, Service_Description AS Service_Description FROM GCP_BILLING_EXPORT WHERE (Project_Id IS NOT NULL) AND (Cost_Type LIKE '%regular%') AND (Credit_Name IS NULL) GROUP BY timeInterval_Month, Service_Description ORDER BY Cost DESC",
  "dataGranularity": "MONTHLY",
  "timeRange": {
    "last": 1,
    "excludeCurrent": true
  },
  "limit": -1
}