To query and visualize billing metrics, use the Billing Usage and Projected Cost dashboards.
These dashboards provide visualizations on the following billing related metrics:
server_org_countkube_namespace_resource_usagepod:kube_pod_container_resource_requests:summetering_storage_organization_allocated_capacity_bytesmetering_storage_allocated_capacity_bytesmetering_gdcbackup_protected_pods_countmetering_gdcbackup_protected_vms_countai_vision_usageai_speech_audio_length_sumai_translation_usage_codepoints
Through these dashboards, you can filter the metric values by namespace, project name, or billing account ID.
Before you begin
Before accessing the Billing reports page, request the required Grafana Viewer role from your IAM Org Admin:
- Organization: Request the Organization Grafana Viewer (
organization-grafana-viewer) role. - Project: Request the Project Grafana Viewer (
project-grafana-viewer) role for your project.
Filter namespace metric values
- To filter metric values by labels on namespaces, perform the following query in the Explore page of the monitoring instance:
sum by (label_CONVERTED_LABEL_NAME) (METRIC_NAME{} * on (cluster, namespace) group_left(label_CONVERTED_LABEL_NAME) kube_namespace_labels{label_CONVERTED_LABEL_NAME="LABEL_VALUE"})
Replace the following variables:
- CONVERTED_LABEL_NAME: the label key to filter metric
values. Replace all non-alphabetic characters in this label with the
underscore
_. For example:app.kubernetes.io/componentbecomesapp_kubernetes_io_component. - METRIC_NAME: the name of the billing-related metrics.
- LABEL_VALUE: the label value to filter metrics.
Filter pod metric values
- To filter metric values by labels on pods, perform the following query in the Explore page of the monitoring instance:
sum by (label_CONVERTED_LABEL_NAME) (METRIC_NAME{} * on (cluster, namespace, pod) group_left(label_CONVERTED_LABEL_NAME) kube_pod_labels{label_CONVERTED_LABEL_NAME="LABEL_VALUE"})