Specify a single gke cluster for gcp error reporting service

223 views Asked by At

I've multiple gke clusters (stg, dev, prod), And I'm using the error reporting service to get alerts about errors, so is there anyway to filter the errors based on the gke cluster name, e.g (getting only errors from the prod cluster)

1

There are 1 answers

4
Gabriel Robledo Ahumada On

The short answer is: this is not possible with Error Reporting because there are only a few text matching filters that can be applied, and none of them could be used as a cluster's identifier.

Being said that, there is a way to get alerts for the errors seen in Cloud Logging for a particular cluster. Just run the following query in the Cloud Logging Logs Explorer using your own cluster's name:

resource.type="k8s_pod"
resource.labels.cluster_name="your-cluster-name"
jsonPayload.message:"error"

Once run, click on the "create alert" button; a walk-through wizard will appear where you can customize it by setting up timers, notification channels, etc.