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

rq_ metrics are not collected by the exporter #33

Open
ben5556 opened this issue Dec 1, 2023 · 6 comments
Open

rq_ metrics are not collected by the exporter #33

ben5556 opened this issue Dec 1, 2023 · 6 comments

Comments

@ben5556
Copy link

ben5556 commented Dec 1, 2023

The below metrics are not collected by the exporter

rq_workers | Gauge | name, queues, state | RQ workers
rq_jobs | Gauge | queue, status | RQ jobs by queue and status
rq_workers_success_total | Counter | name, queues | Successful job count by worker
rq_workers_failed_total | Counter | name, queues | Failed job count by worker
rq_workers_working_time_total | Counter | name, queues | Total working time in seconds by worker

Debug logs of the container:

[2023-12-01 18:33:56] [rq_exporter.collector] [DEBUG]: Collecting the RQ metrics...
[2023-12-01 18:33:56] [rq_exporter.collector] [DEBUG]: RQ metrics collection finished
[2023-12-01 18:33:56] [rq_exporter] [INFO]: Serving the application on 0.0.0.0:9726
[2023-12-01 18:34:00] [rq_exporter.collector] [DEBUG]: Collecting the RQ metrics...
[2023-12-01 18:34:00] [rq_exporter.collector] [DEBUG]: RQ metrics collection finished
[2023-12-01 18:34:04] [rq_exporter.collector] [DEBUG]: Collecting the RQ metrics...
[2023-12-01 18:34:04] [rq_exporter.collector] [DEBUG]: RQ metrics collection finished
[2023-12-01 18:34:14] [rq_exporter.collector] [DEBUG]: Collecting the RQ metrics...
[2023-12-01 18:34:14] [rq_exporter.collector] [DEBUG]: RQ metrics collection finished
[2023-12-01 18:34:15] [rq_exporter.collector] [DEBUG]: Collecting the RQ metrics...
[2023-12-01 18:34:15] [rq_exporter.collector] [DEBUG]: RQ metrics collection finished
[2023-12-01 18:34:24] [rq_exporter.collector] [DEBUG]: Collecting the RQ metrics...
[2023-12-01 18:34:24] [rq_exporter.collector] [DEBUG]: RQ metrics collection finished
[2023-12-01 18:34:30] [rq_exporter.collector] [DEBUG]: Collecting the RQ metrics...
[2023-12-01 18:34:30] [rq_exporter.collector] [DEBUG]: RQ metrics collection finished

Metrics exposed by the exporter

# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 258.0
python_gc_objects_collected_total{generation="1"} 268.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable objects found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 65.0
python_gc_collections_total{generation="1"} 5.0
python_gc_collections_total{generation="2"} 0.0
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="3",minor="8",patchlevel="17",version="3.8.17"} 1.0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 2.58596864e+08
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 3.0138368e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.70145563537e+09
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.19
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 7.0
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1.048576e+06
# HELP rq_request_processing_seconds Time spent collecting RQ data
# TYPE rq_request_processing_seconds summary
rq_request_processing_seconds_count 22.0
rq_request_processing_seconds_sum 0.03231144789606333
# HELP rq_request_processing_seconds_created Time spent collecting RQ data
# TYPE rq_request_processing_seconds_created gauge
rq_request_processing_seconds_created 1.7014556361013677e+09
# HELP rq_workers RQ workers
# TYPE rq_workers gauge
# HELP rq_workers_success_total RQ workers success count
# TYPE rq_workers_success_total counter
# HELP rq_workers_failed_total RQ workers fail count
# TYPE rq_workers_failed_total counter
# HELP rq_workers_working_time_total RQ workers spent seconds
# TYPE rq_workers_working_time_total counter
# HELP rq_jobs RQ jobs by state
# TYPE rq_jobs gauge
@ben5556
Copy link
Author

ben5556 commented Dec 1, 2023

Using latest docker image

@mdawar
Copy link
Owner

mdawar commented Dec 2, 2023

It seems that you don't have any workers running and there are no jobs enqueued, this is the initial state when there are no metrics to display.

Take a look at the docker-compose.yml file for a complete example, you can start an example dev environment using docker compose up.

@ben5556
Copy link
Author

ben5556 commented Dec 2, 2023 via email

@mdawar
Copy link
Owner

mdawar commented Dec 2, 2023

The Prometheus client automatically exports a 0 value for metrics without labels, all the metrics that you referred to have labels and are only exported when the data is available.

@ben5556
Copy link
Author

ben5556 commented Dec 2, 2023 via email

@pen-pal
Copy link

pen-pal commented Jun 5, 2024

were you able to fix it?

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

No branches or pull requests

3 participants