Google PubSub - 计算主题中的消息 [英] Google PubSub - Counting messages in topic

查看:26
本文介绍了Google PubSub - 计算主题中的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我查看了 Google 的 PubSub 的文档,也尝试查看 Google Cloud Monitoring,但找不到任何方法来确定我的主题中的队列大小.

I've looked over the documentation for Google's PubSub, and also tried looking in Google Cloud Monitoring, but couldn't find any means of figuring out what's the queue size in my topics.

由于我计划使用 PubSub 进行分析,因此监控队列数量对我来说很重要,这样我就可以增加/减少订阅者数量.

Since I plan on using PubSub for analytics, it's important for me to monitor the queue count, so I could scale up/down the subscriber count.

我错过了什么?

推荐答案

您要查看的指标是未传递的消息".您应该能够在 Google Cloud Monitoring 中的Pub/订阅"资源类型.订阅者尚未确认的消息数量,即队列大小,是每个订阅的指标,而不是每个主题的指标.有关指标的信息,请参阅 pubsub.googleapis.com/subscription/num_undelivered_messagesrel="noreferrer">GCP 指标列表(以及其他所有可用的 Pub/Sub 指标).

The metric you want to look at is "undelivered messages." You should be able to set up alerts or charts that monitor this metric in Google Cloud Monitoring under the "Pub/Sub Subscription" resource type. The number of messages that have not yet been acknowledged by subscribers, i.e., queue size, is a per-subscription metric as opposed to a per-topic metric. For info on the metric, see pubsub.googleapis.com/subscription/num_undelivered_messages in the GCP Metrics List (and others for all of the Pub/Sub metrics available).

这篇关于Google PubSub - 计算主题中的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆