[英]GCP PubSub difference between undelivered messages and dead letter messages
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 .我正在创建警报系统来检查死消息队列,在这个GCP 文档中我看到有两个指标subscription/num_undelivered_messages和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?
如果是这种情况,这些指标报告的数字不是相同吗?
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.
它一直处于该状态,直到收到 ACK 消息。
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).在几次不成功(nack、error、timeout,...)投递(至少 5 次,您可以设置低于 5 次)后,您的消息可以投递到死信主题(如果已配置)。
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:黄金信号:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.