Skip to content

Latest commit

 

History

History
53 lines (45 loc) · 4.45 KB

File metadata and controls

53 lines (45 loc) · 4.45 KB

GKE Compute Metrics

Metric name Metric type Description Labels
cloudcost_gcp_gke_instance_cpu_usd_per_core_hour Gauge The processing cost of a GCP Compute Instance, associated to a GKE cluster, in USD/(core*h) cluster_name=<name of the cluster the instance is associated with>
instance=<name of the compute instance>
region=<GCP region code>
family=<broader compute family (n1, n2, c3 ...) >
machine_type=<specific machine type, e.g.: n2-standard-2>
project=<GCP project, where the instance is provisioned>
price_tier=<spot|ondemand>
cloudcost_gcp_gke_compute_instance_memory_usd_per_gib_hour Gauge The memory cost of a GCP Compute Instance, associated to a GKE cluster, in USD/(GiB*h) cluster_name=<name of the cluster the instance is associated with>
instance=<name of the compute instance>
region=<GCP region code>
family=<broader compute family (n1, n2, c3 ...) >
machine_type=<specific machine type, e.g.: n2-standard-2>
project=<GCP project, where the instance is provisioned>
price_tier=<spot|ondemand>
cloudcost_gcp_gke_persistent_volume_usd_per_hour Gauge The cost of a GKE Persistent Volume in USD/(GiB*h) cluster_name=<name of the cluster the instance is associated with>
namespace=<The namespace the pvc was created for>
persistentvolume=<Name of the persistent volume>
region=<The region the pvc was created in>
project=<GCP project, where the instance is provisioned>
storage_class=<pd-standard|pd-ssd|pd-balanced|pd-extreme>
disk_type=<boot_disk|persistent_volume>

Persistent Volumes

There's two sources of data for persistent volumes:

  • Skus from the Billing API
  • Disk metadata from compute API

There's a bit of a disconnect between the two. Sku's descriptions have the following format:

Balanced PD Capacity in <Region>
Commitment v1: Local SSD In <Region>
Extreme PD Capacity in <Region>
Extreme PD IOPS in <Region>
Hyperdisk Balanced Capacity in <Region>
Hyperdisk Balanced IOPS in <Region>
Hyperdisk Balanced Throughput in <Region>
Hyperdisk Extreme Capacity in <Region>
Hyperdisk Extreme IOPS in <Region>
Hyperdisk Throughput Capacity in <Region>
Hyperdisk Throughput Throughput Capacity in <Region>
Regional Balanced PD Capacity in <Region>
Regional SSD backed PD Capacity in <Region>
Regional Storage PD Capacity in <Region>
SSD backed Local Storage attached to Spot Preemptible VM in <Region>
SSD backed Local Storage in <Region
SSD backed PD Capacity in <Region>
Storage PD Capacity in <Region>

Generically, the sku descriptions have the following format:

<sku-type> PD Capacity in <Region>

Disk metadata has the following format:

projects/<project>/zones/<zone>/disks/<disk-type>

To map the sku to the disk type, we can use the following mapping:

  • Storage PD Capacity -> pd-standard
  • SSD backed PD Capacity -> pd-ssd
  • Balanced PD Capacity -> pd-balanced
  • Extreme PD Capacity -> pd-extreme