Skip to content

feat(metrics): emit prometheus metrics alongside statsd - #14

Open
StaberindeZA wants to merge 5 commits into
mainfrom
ent-87-switch-prometheus
Open

StaberindeZA wants to merge 5 commits into
mainfrom
ent-87-switch-prometheus

Conversation

@StaberindeZA

@StaberindeZA StaberindeZA commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Because

  • We're moving from StatsD to Prometheus, and the dashboards need both until scraping is live and they're rebuilt

This pull request

  • Serves every metric with prom-client at GET /metrics on a separate port in all four apps (PROMETHEUS_CONFIG__PORT, default 9464), outside the Nest app so ingress, auth and middleware never see it
  • Emits each StatsD metric to Prometheus as well, defined in per-domain metric classes so each app only serves its own metrics; StatsD is removed in a follow-up ticket

Deployment notes

  • Add one PodMonitoring per app (ENT-89) on container port 9464, so job names the app as the STATS_D_CONFIG__PREFIX does today, and keep that port off every ingress, since its labels include client IDs and slugs
  • Add a preStop sleep of at least the scrape interval (e.g. sleep 30) to all four Deployments, so the last metrics before shutdown are scraped
  • Query gauges with max without (pod, instance): a pod clears a scheduled job's gauges when another instance owns the job

Issue that this pull request solves

Closes: ENT-87

Checklist

  • My commits are GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have manually reviewed all AI generated code.

Because:

- We're moving from StatsD to Prometheus, and dashboards need both until scraping is live

This commit:

- Serves every metric at /metrics on a separate in-cluster port in all four apps

Closes ENT-87
@StaberindeZA
StaberindeZA force-pushed the ent-87-switch-prometheus branch from d6ad507 to ae6290b Compare November 24, 2026 20:36
@StaberindeZA
StaberindeZA marked this pull request as ready for review November 24, 2026 21:18

This branch has not been deployed

No deployments
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.

1 participant