-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat(exporter): Add endpoint for RQ metrics #150
base: master
Are you sure you want to change the base?
Conversation
fde0a3a
to
e6c7c22
Compare
Looks good. Needs a few changes. The exemption you added will make Add "rq" in https://github.com/frappe/press/blob/26205eb65e9fd32234114299f17809424e63bfbf/press/api/monitoring.py#L55 So Prometheus scrapes this endpoint. |
e6c7c22
to
a47c740
Compare
def get_bench_metrics(bench): | ||
from prometheus_client.exposition import generate_latest | ||
|
||
return generate_latest(RQCollector(bench)) or "asa" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"asa"
???
Looking at diff I can't quite figure out how will this work with bench workers... is this only intended for Agent RQ workers? |
def get_bench_metrics(bench): | ||
from prometheus_client.exposition import generate_latest | ||
|
||
return generate_latest(RQCollector(bench)) or "asa" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop this stray. I don't know why I added it.
|
||
rq_jobs = GaugeMetricFamily("rq_jobs", "RQ jobs by state", labels=["bench", "queue", "status"]) | ||
|
||
workers = get_workers_stats(REDIS_PORT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this hardcoded port. You will have to expose redis_queue ports to 127.0.0.1
Ref:
Lines 694 to 705 in 48f4dd3
ssh_port = self.bench_config.get("ssh_port", self.bench_config["web_port"] + 4000) | |
ssh_ip = self.bench_config.get("private_ip", "127.0.0.1") | |
bench_directory = "/home/frappe/frappe-bench" | |
mounts = self.prepare_mounts_on_host(bench_directory) | |
command = ( | |
"docker run -d --init -u frappe " | |
f"--restart always --hostname {self.name} " | |
f"-p 127.0.0.1:{self.bench_config['web_port']}:8000 " | |
f"-p 127.0.0.1:{self.bench_config['socketio_port']}:9000 " | |
f"-p 127.0.0.1:{self.bench_config['codeserver_port']}:8088 " |
Closes frappe/press#1283
TODO:- Add to
nginx.conf