Reputation: 1270
I am running a GKE cluster and I have a statefulset that uses dynamically provisioned persistent disks.
I want to create a dashboard widget where I can see the disk[write|read] operations/throughput for all of those disks. I have a lot of disks and I don't want to manually filter by their name, I want to filter by a custom label.
I added a new storage class in k8s which attaches a label of my choice to each disk upon creation:
...
parameters:
labels: app=my-app
type: pd-balanced
provisioner: pd.csi.storage.gke.io
...
How can I filter all disks by that label(app
) in the Metrics Explorer tab in GCP?
Upvotes: 0
Views: 168
Reputation: 175
To filter disk metrics in Google Cloud Platform (GCP) by a custom label, you can follow these steps:
Go to the Google Cloud Console and select your project. In the Navigation menu go to Monitoring>Metrics Explorer.
Filter by Resource Type- A resource type specifies from which resource the metric data is captured. Set the resource type to gce_pd (Persistent Disk).This will allow you to focus on metrics related to your disks.
Select the Metric, the metric type identifies the measurements to be collected from a resource.
You can identify the label as follows: Click on “Add filter” and select the appropriate label key you've set.
Set the filter value to my-app, You can choose to aggregate metrics by mean, sum, or count depending on your needs. By adjusting aggregation elements can change the number of time series that your chart displays. The settings in the Aggregation element can change the number of time series that your chart displays.
Choose how to visualize the data and select the time range for the metrics you want to display. Finally, after configuring your filters and visualizations, click on "Save to Dashboard" and also name the widget for easy identification.
For more information refer to this blog by Oscar L Villalon and official GCP document on select metrics using metric explorer and document on metric types.
Upvotes: 0