Reputation: 442
I am creating alert systems to check dead message queues and in this GCP Document I see there are two metrics subscription/num_undelivered_messages and subscription/dead_letter_message_count. I find it hard to understand the difference since I assume undelivered messages are being published to the dead message queue. If that's the case, aren't these metrics reporting the same number?
Upvotes: 0
Views: 493
Reputation: 75715
You have to understand the flow to understand the metrics.
When a message arrive in the Subscription, it is undelivered. It stays in that state up to receiving a ACK message.
After several unsuccessful (nack, error, timeout,...) deliveries (at least 5, you can set lower than 5), your message can be delivered to a Dead Letter topic (if configured).
The undelivered messages can stay minutes, hours or days in the subscription, before being delivered to the Dead letter topic.
That being said, now what do you want to monitor?
Depends on your use case, but the ratio, the speed, the frequency of those metrics can indicate the health of your app.
Golden signals:
Upvotes: 1