Skip to content

SD-11577: add queue health metrics#13

Merged
rtalvarez merged 1 commit intomasterfrom
queue-metrics
Mar 19, 2026
Merged

SD-11577: add queue health metrics#13
rtalvarez merged 1 commit intomasterfrom
queue-metrics

Conversation

@rtalvarez
Copy link
Member

@rtalvarez rtalvarez commented Mar 19, 2026

Pull Request Template

Description

Adds the following metrics, related to queue health

  • cloudflare_queue_backlog_messages: Average number of messages in queue backlog
  • cloudflare_queue_backlog_bytes: Average backlog size in bytes
  • cloudflare_queue_consumer_concurrency: Average number of concurrent queue consumers
  • cloudflare_queue_operations_count: Number of queue message operations by action type and outcome
  • cloudflare_queue_operations_bytes: Total bytes processed by queue message operations
  • cloudflare_queue_operations_lag_time: Average lag time between write and read/delete (milliseconds)
  • cloudflare_queue_operations_retry_count: Average retry count for queue message operations

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Other (please describe):

Testing

Ran the app locally and verified the following graphql query gets executed correctly

DEBUG[2026-03-19 11:24:33] func:main.NewGraphQLClient.func1 file:graphql.go >> query:
        query ($accountID: String!, $mintime: Time!, $maxtime: Time!, $limit: Int!) {
                viewer {
                        accounts(filter: {accountTag: $accountID}) {
                                queueBacklogAdaptiveGroups(limit: $limit, filter: {datetime_geq: $mintime, datetime_lt: $maxtime}) {
                                        dimensions {
                                                queueId
                                        }
                                        avg {
                                                messages
                                                bytes
                                        }
                                }
                                queueConsumerMetricsAdaptiveGroups(limit: $limit, filter: {datetime_geq: $mintime, datetime_lt: $maxtime}) {
                                        dimensions {
                                                queueId
                                        }
                                        avg {
                                                concurrency
                                        }
                                }
                                queueMessageOperationsAdaptiveGroups(limit: $limit, filter: {datetime_geq: $mintime, datetime_lt: $maxtime}) {
                                        dimensions {
                                                queueId
                                                actionType
                                                outcome
                                        }
                                        sum {
                                                billableOperations
                                                bytes
                                        }
                                        avg {
                                                lagTime
                                                retryCount
                                        }
                                }
                        }
                }
        }

I have also verified that the new metrics are available on localhost:8080/metrics

Code Quality

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Before Submitting

Please ensure you have completed the following before submitting your PR:

# Run comprehensive tests
make pr-tests

If the above command fails, please fix the issues before submitting your PR.

Additional Notes

Add any other context about the pull request here.

@rtalvarez rtalvarez merged commit c2c1be6 into master Mar 19, 2026
3 checks passed
@exokernel exokernel deleted the queue-metrics branch March 20, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants