Skip to content

feat(core): Add a non-endpoint /qlen route#297

Open
ketiltrout wants to merge 1 commit into
more_old_testsfrom
qlen
Open

feat(core): Add a non-endpoint /qlen route#297
ketiltrout wants to merge 1 commit into
more_old_testsfrom
qlen

Conversation

@ketiltrout

@ketiltrout ketiltrout commented Jul 15, 2026

Copy link
Copy Markdown
Member

This is the first part of the promethues metrics client fix. The goal here is to remove the need for prometheus in the client.

The client used to fetch the /metrics from the metrics server and then extract the queue length from that to report to the user the queue length.

But Sanic can just as easily fetch the queue length from redis as the metric server (which runs in qworker proces) can. So, I've implemented a non-endpoint route /qlen which simply returns the queue length (as plain text) when hit.

For ease of testing only, this requires #296.

@ketiltrout
ketiltrout marked this pull request as draft July 15, 2026 20:00
@ketiltrout
ketiltrout changed the base branch from value_params to chime-upgrade July 15, 2026 20:00
@ketiltrout ketiltrout changed the title perf(core): Add a non-endpoint /qlen route refactor(core): Add a non-endpoint /qlen route Jul 15, 2026
@ketiltrout ketiltrout changed the title refactor(core): Add a non-endpoint /qlen route feat(core): Add a non-endpoint /qlen route Jul 15, 2026
@ketiltrout
ketiltrout changed the base branch from chime-upgrade to more_old_tests July 16, 2026 01:07
@ketiltrout
ketiltrout marked this pull request as ready for review July 16, 2026 01:08
This is the first part of the promethues metrics client fix.  The
goal here is to remove the need for prometheus in the client.

The client used to fetch the `/metrics` from the metrics server and then
extract the queue length from that to report to the user the queue
length.

But Sanic can just as easily fetch the queue length from redis as the
metric server (which runs in qworker proces) can.  So, I've implemented
a non-endpoint route `/qlen` which simply returns the queue length (as
plain text) when hit.

This removes the `prometheus_client` from the client.
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