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

feat(exporter): Add endpoint for RQ metrics #150

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

tarunps
Copy link
Member

@tarunps tarunps commented Jan 3, 2025

Closes frappe/press#1283

  • Adds endpoint to fetch RQ metrics for all benches on server
  • Adds endpoint to fetch RQ metrics per bench
  • Exempts all benches endpoint from token validation
    • Will be proxying this through nginx metrics endpoints and that has it's own validation setup
    • Force redirect the agent endpoint to nginx one

TODO:
- Add to nginx.conf

		location /agent/benches/metrics {
			return 301 /metrics/rq;
		}
		location /metrics/rq {
			proxy_pass http://127.0.0.1:25052/benches/metrics;
		}

@tarunps tarunps force-pushed the feat/agent-rq-monitor branch 2 times, most recently from fde0a3a to e6c7c22 Compare January 3, 2025 08:05
@adityahase
Copy link
Member

adityahase commented Jan 3, 2025

Looks good. Needs a few changes.

The exemption you added will make /agent/benches/metrics publicly accessible without credentials. Add a forced redirect in NGINX config to /metrics/rq.

Add "rq" in https://github.com/frappe/press/blob/26205eb65e9fd32234114299f17809424e63bfbf/press/api/monitoring.py#L55 So Prometheus scrapes this endpoint.

agent/exporter.py Outdated Show resolved Hide resolved
@ankush
Copy link
Member

ankush commented Jan 6, 2025

Looking at diff I can't quite figure out how will this work with bench workers... is this only intended for Agent RQ workers?

agent/exporter.py Outdated Show resolved Hide resolved
agent/exporter.py Outdated Show resolved Hide resolved
@tarunps tarunps force-pushed the feat/agent-rq-monitor branch 4 times, most recently from 3d1fd0d to 3ad6449 Compare February 3, 2025 04:43
@tarunps tarunps force-pushed the feat/agent-rq-monitor branch from 3ad6449 to 89f9ceb Compare February 3, 2025 07:59
@adityahase adityahase merged commit 9650bfb into frappe:master Feb 10, 2025
2 checks passed
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.

Setup monitoring for Redis RQ
3 participants