简体   繁体   English

GCP PubSub 未投递消息和死信消息之间的区别

[英]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_messagessubscription/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?话虽如此,现在您要监视什么?

  • The number of messages that are stacked in your subscription to understand the backlogs that you have to process?为了解您必须处理的积压工作而堆积在您的订阅中的消息数量?
  • The number of messages pushed to Dead Letter topic because there were a definitive error, and all the retries were unsuccessful?因为有一个明确的错误,并且所有的重试都不成功,所以推送到死信主题的消息数量?

Depends on your use case, but the ratio, the speed, the frequency of those metrics can indicate the health of your app.取决于您的用例,但这些指标的比率、速度、频率可以表明您的应用程序的健康状况。

Golden signals:黄金信号:

  • error rate: Number of message in the Dead Letter topic错误率:死信主题中的消息数
  • Traffic: Number of message undelivered流量:未发送的消息数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GCP Pubsub 未传递消息的数量不会改变 - GCP Pubsub num of undelivered messages wont change GCP - 如何添加关于发送到 pubsub 死信队列的消息数量的警报? - GCP - how to add alert on number of messages sent to a pubsub dead letter queue? Google PubSub 将消息订购到死信队列流程 - Google PubSub ordered Messages to Dead Letter Queue process 针对不同类型的故障使用不同的 GCP PubSub 死信主题 - Different GCP PubSub dead letter topics for different types of failures 将消息发布到GCP pubSub主题失败 - publishing messages to GCP pubSub topic fails GCP PubSub 排序不排序消息 - GCP PubSub ordering does not order messages 如何使用 python 客户端库获取 Pubsub 中存在的未传递消息(metric api)的数量? - How can I get the number of undelivered messages (metric api) present in Pubsub using python client library? GKE:具有推送订阅者的 Pod 之间的 Pubsub 消息 - GKE: Pubsub messages between pods with push subscribers GCP Cloud Function 未正确拾取/确认 PubSub 消息 - GCP Cloud Function not correctly picking up/acknowledging PubSub messages 如何将死信消息路由回原始主题? - How to route dead letter messages back to the original topic?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM