Can GKE filter logs by application?

423 views Asked by At

We are GKE managing several applications:

  • app1
  • app2
  • app3

In GCP Error Reporting dashboard, errors are intermixed for all the applications. For example, the errors below are coming from a different app.

enter image description here

However in the Configure Notifications tab, there is no option to setup alerts based on app/conditions.

I'd like to be able to setup different notifcation channels depending on app eg. app1 -> slack, app2 -> email. We have different ops team that handle these apps and having them go to a shared, noisy Slack channel is not ideal. Also, it would be great to setup alerts based on exception details - for example all Java RuntimeExceptions result in different alerts.

What the conventional way to setup fine-grained alerts like these?

1

There are 1 answers

0
Adam Hughes On

In the GCP Logs explorer (if in the legacy explorer, need to click upgrade) you can create an alert using this button, which will let you setup an alert anytime some criteria is met based on a log condition.

enter image description here

It will then create an entry in the monitoring tab under alerting and the rest is straightforward

enter image description here