Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCP - how to add alert on number of messages sent to a pubsub dead letter queue?

I have my application which processes messages from a pubsub topic and if it fails the message is send to a separate dlq topic. I want to be able to set an alarm in monitoring that when during a day there were 30k messages sent to the dlq it notifies me and I can check why my service is not wokring.

I tried to set up some polices in gcp but I don't know and couldn't find anywhere in the docs how to setup a metric of daily processed messages on a topic. Can anyone help me ?

like image 409
Clyde Barrow Avatar asked Oct 29 '25 05:10

Clyde Barrow


1 Answers

You can create a new alert policy like this

enter image description here

PubSub subscription/unacked messages.

You can add a filter on your subscription name if you have several subscriptions in your project.

Add the notification channel that you want, an email in my case. After few minutes, you can see the first alert enter image description here

And the email enter image description here

EDIT

For the acked messages, you can do this

enter image description here

I never tried an aggregation over 1 day, but it should be OK.

like image 64
guillaume blaquiere Avatar answered Oct 31 '25 01:10

guillaume blaquiere



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!