Reference

Google Cloud cost by a hierarchy of labels

Returns Google Cloud spend grouped by up to three label keys at once, for example cluster, namespace and workload. A resource label wins over the same key set on its project.

GET
/api/v1/costs/by-labels

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

provider?Provider
key*array<string>

Label keys, in order

filter?array<string>|

key=value pairs to narrow to

start?string|null
end?string|null
credits?Credits

Cost basis for Google Cloud: after credits (default) or before them. AWS stays on its invoiced basis.

include_project_labels?Include Project Labels
limit?Limit

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/costs/by-labels?key=string"
{
  "success": true,
  "timestamp": "2019-08-24T14:15:22Z",
  "data": {
    "keys": [
      "string"
    ],
    "credits": "before",
    "total": 0,
    "unlabeled": 0,
    "items": [
      {
        "values": {
          "property1": "string",
          "property2": "string"
        },
        "cost": 0,
        "share_pct": 0
      }
    ]
  }
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "details": null
  },
  "timestamp": "2019-08-24T14:15:22Z"
}
Ask the FinOps Agent about your cloud spend