Skip to content

prom-wrapper: introduce src-prometheus, migrate alerts history

Warren Gifford requested to merge prom-wrapper/extract-prometheus into main

Created by: bobheadxi

Was doing a review of the prom-wrapper code and remembered this old code I wrote lying around for the frontend making a direct query to Prometheus, which powers the alerts overview in the bug reports page. There's a few very manual API requests to the prom-wrapper as well. Sadly it seems I wrote some pretty bad code here and figured it might be a good idea to get this cleaned up a bit. Then I got into it and updated all the frontend->prom-wrapper touch points (more than I recalled) into a new package, src-prometheus

This PR:

  • removes the frontend->prometheus direct querying, and lets the prom-wrapper handle it (it already provides aggregated overviews for alerts.hideObservabilitySiteAlerts)
  • introduces the src-prometheus package for the prom-wrapper API, and replaces all touch points with the prom-wrapper with usage of this API
  • leverage the src-prometheus package in the prom-wrapper

Post-this PR I would advocate to move prom-wrapper out of docker-images and into a top-level cmd/prom-wrapper since doing this I realized there's a lot more to prom-wrapper than just a reverse-proxy for alertmanager and prometheus

Merge request reports

Loading