Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export RQ statistics as prometheus metrics #666

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

terencehonles
Copy link
Contributor

@terencehonles terencehonles commented Aug 16, 2024

This change follows the implementation of rq_exporter and the prometheus client to export the RQ statistics as a Django view.

fixes: #503

@terencehonles terencehonles force-pushed the export-prometheus-metrics branch 3 times, most recently from 288bbf5 to 30e3eb4 Compare August 16, 2024 13:43
django_rq/apps.py Outdated Show resolved Hide resolved
@terencehonles terencehonles force-pushed the export-prometheus-metrics branch 5 times, most recently from 79f6394 to 70f07f8 Compare August 19, 2024 06:04
@terencehonles terencehonles force-pushed the export-prometheus-metrics branch from 70f07f8 to de7de29 Compare November 18, 2024 16:24
@terencehonles terencehonles force-pushed the export-prometheus-metrics branch from de7de29 to 84c84bf Compare November 18, 2024 16:32

with self.summary.time():
rq_workers = GaugeMetricFamily('rq_workers', 'RQ workers', labels=['name', 'state', 'queues'])
rq_workers_success = CounterMetricFamily('rq_workers_success', 'RQ workers success count', labels=['name', 'queues'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename rq_workers_success to successful_job_count?

rq_workers = GaugeMetricFamily('rq_workers', 'RQ workers', labels=['name', 'state', 'queues'])
rq_workers_success = CounterMetricFamily('rq_workers_success', 'RQ workers success count', labels=['name', 'queues'])
rq_workers_failed = CounterMetricFamily('rq_workers_failed', 'RQ workers fail count', labels=['name', 'queues'])
rq_workers_working_time = CounterMetricFamily('rq_workers_working_time', 'RQ workers spent seconds', labels=['name', 'queues'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

total_working_time?

@selwin
Copy link
Collaborator

selwin commented Dec 17, 2024

I don't mind merging this in, but could you document this feature? A simple unit test to show that this view works would also be great.

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.

can we expose /metrics in django-rq?
2 participants