Flagsmith / Flagsmith/flagsmith

Track per-worker RSS memory via Prometheus

Open
#6,814 1 comment 0 reactions 0 assignees View on GitHub
api improvement infrastructure
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

## Summary

Expose per-worker RSS memory as a Prometheus gauge so we can track memory growth over time in Grafana. This is essential for detecting memory leaks in production — RSS growth is often invisible to Python-level profilers, so process-level metrics are the only reliable signal.

## Requirements

- Expose a Prometheus gauge metric (e.g. `flagsmith_worker_rss_bytes`) labelled by worker PID.
- The metric should report the RSS of the current process (e.g. via `resource.getrusage` or `/proc/self/status`).
- Updated on each request or periodically via a background thread.

## Acceptance Criteria

- [ ] Prometheus metric is exported with a `pid` label.
- [ ] Grafana dashboard shows per-worker RSS over time.
- [ ] We can observe whether individual workers grow monotonically or stabilise.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.