Query billing metrics

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_count
  • kube_namespace_resource_usage
  • pod:kube_pod_container_resource_requests:sum
  • metering_storage_organization_allocated_capacity_bytes
  • metering_storage_allocated_capacity_bytes
  • metering_gdcbackup_protected_pods_count
  • metering_gdcbackup_protected_vms_count
  • ai_vision_usage
  • ai_speech_audio_length_sum
  • ai_translation_usage_codepoints

Through these dashboards, you can filter the metric values by namespace, Task Order (TO), or Contract Line Item Number (CLIN).

Before you begin

To get the permissions you need to access the billing usage and projected cost dashboards, ask your Organization IAM admin to grant you the corresponding role in the applicable namespace.

Filter namespace metric values

  • To filter metric values by labels on namespaces, perform the following query in the Explore page of the monitoring instance:
none 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/component becomes app_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:
none 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})