Skip to content

Track per-worker RSS memory via Prometheus #6814

@gagantrivedi

Description

@gagantrivedi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiIssue related to the REST APIimprovementImprovement to the existing platforminfrastructure

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions