I have a Python script set up under App Engine that runs through all of the projects within our organisation that collects data on:
- The disks not associated with snapshot policies
- The snapshot policies that do not have "daily" or "weekly" in their name (and are thus outside our naming convention)
Taking the former as the example, the JSON payload within the Stackdriver log is like:
jsonPayload: {
DiskWithoutPolicy: "True"
diskId: "1234567891234567891"
diskName: "server-disk3"
project: "projectID"
}
When I go to create the Alerting Policy, Metrics Explorer only allows me to filter on the log's resource labels (listed here: https://cloud.google.com/monitoring/api/resources):
resource: {
labels: {
module_id: "get_googlecloud_snapshotstatus"
project_id: "projectID"
version_id: ""
zone: "europe-west1-d"
}
Can Metrics Explorer filter on the JSON payload, so I can therefore see the 'diskId', 'diskName' and 'project'?
If not, is there any other way of achieving what I need?