Skip to content

Pubsub feature: get messages count waiting in subscription #527

Description

@pierre-b

Hi,

I need to know how many messages are waiting in the subscription, to pop new workers or monitor the health of my system. This is something AWS SQS does too.

Is it in the roadmap actually ?

Thank you

Activity

  1. pierre-b commented on May 5, 2015

    @pierre-b
    Author

    FYI: as https://code.google.com/p/cloud-pubsub/issues/detail?id=13 told me, there is a "num_undelivered_messages" endpoint to get that metric.

  2. ryanseys commented on May 5, 2015

    @ryanseys
    Contributor

    Considering it's "not accurate" I wouldn't use it yet and don't think we should support it in this library until we know it is accurate.

  3. pierre-b commented on May 5, 2015

    @pierre-b
    Author

    This feature could never be accurate because messages are always flowing into the subscription (depending on the publish rate), but it's crucial to know if you need to add more workers to process messages or monitor the health of your workers.

  4. stephenplusplus commented on May 5, 2015

    @stephenplusplus
    Contributor

    From https://cloud.google.com/monitoring/api/metrics, they list two interesting ones:

    num_outstanding_messages: Current number of messages delivered but not yet acknowledged.
    num_undelivered_messages: Current number of messages pending to be delivered.

    Maybe we could open up a generic subscription.getMetrics('num_outstanding_msesages') and anything else from the list: topic.getMetrics('message_sizes'), as these may all be useful.

  5. stephenplusplus commented on Aug 24, 2015

    @stephenplusplus
    Contributor

    Assigned this to @callmehiphop since you had some ideas for how to implement this generically.

  6. leibale commented on Dec 10, 2015

    @leibale
    Contributor

    what about this one?

  7. stephenplusplus commented on Dec 11, 2015

    @stephenplusplus
    Contributor

    We have a few more things to implement with a higher priority before getting to this one, mostly support for the Prediction and Translate APIs, then promises.

  8. leibale commented on Dec 12, 2015

    @leibale
    Contributor

    @stephenplusplus if i will create a pull request, you will merge?

  9. stephenplusplus commented on Dec 12, 2015

    @stephenplusplus
    Contributor

    That would be great!

  10. sssahas commented on Mar 31, 2017

    @sssahas

    Great to see you guys working on this already. If its worth, right now I use stackdriver's subscription metrics capabilities to get this information, apparently, stackdriver lags behind and the count is not accurate. Just wanted to add +1 to this request and happy to be a beta tester, if need be. Let me know.

  11. 25 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions