Last active
March 26, 2019 09:13
-
-
Save tanelmae/1bef78c1443f95c01212669e02d2b4bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use gcloud access token to fetch Stackdriver custom metrics descriptions | |
curl --silent --header "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ | |
https://monitoring.googleapis.com/v3/projects/$(gcloud config get-value core/project)/metricDescriptors?filter=metric.type%3Dstarts_with%28%22custom.googleapis.com%2F%22%29 | |
# Get all the custom metrics names with jq | |
curl --silent --header "Authorization: Bearer $(gcloud auth application-default print-access-token)" \ | |
https://monitoring.googleapis.com/v3/projects/$(gcloud config get-value core/project)/metricDescriptors?filter=metric.type%3Dstarts_with%28%22custom.googleapis.com%2F%22%29 | jq '.metricDescriptors[] | .name' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment