Page MenuHomePhabricator

Retire Prometheus 'global' instance
Closed, ResolvedPublic

Description

Since we have Thanos rule in production now (T287142) the Prometheus global instance is not really needed anymore, therefore it should be retired. Outline of steps:

  • Move global rules (mostly recording rules, possibly some alerting rules too) to Thanos rule. Either via alerts.git or Puppet
  • Audit dashboards using global instance and port them to Thanos
  • Soft-disable global by denying HTTP access
  • Remove the puppet bits related to global
  • Nuke the global LV on Prometheus hosts

Dashboards using global

Event Timeline

This would help reclaiming some space at least in eqiad, we have ~700G still free in the vg and getting rid of global would give us another 900G

Dashboards likely using the global instance:

https://grafana.wikimedia.org/d/000000066/resourceloader

I'll convert this one to Thanos. From a quick clickin' around, I notice that 1) the same global/pre-aggrate metrics seem to be available in Thanos already e.g. status_cc_xc:varnish_resourceloader_resp:irate5m instead of varnish_resourceloader_resp, but also that 2) using sum(irate(varnish_resourceloader_resp[5m])) yields the same result (actually slightly more precise, which is not surprising).

Screenshot 2022-11-16 at 15.59.35.png (1,973×1,208 px, 184 KB)

Assuming that's fine, I'll convert these over and remove the source selector.

Change 861825 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] prometheus: move traffic rules off 'global' instance

https://gerrit.wikimedia.org/r/861825

Change 861826 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] prometheus: deprecate traffic 'global' rules

https://gerrit.wikimedia.org/r/861826

Change 861825 merged by Filippo Giunchedi:

[operations/puppet@production] prometheus: move traffic rules to 'ops' instance

https://gerrit.wikimedia.org/r/861825

https://grafana.wikimedia.org/d/000000066/resourceloader

I'll convert this one to Thanos. From a quick clickin' around, I notice that 1) the same global/pre-aggrate metrics seem to be available in Thanos already e.g. status_cc_xc:varnish_resourceloader_resp:irate5m instead of varnish_resourceloader_resp, but also that 2) using sum(irate(varnish_resourceloader_resp[5m])) yields the same result (actually slightly more precise, which is not surprising).

Screenshot 2022-11-16 at 15.59.35.png (1,973×1,208 px, 184 KB)

Assuming that's fine, I'll convert these over and remove the source selector.

Done. I've converted all of the panels now to use Prometheus-Thanos and make the underlying raw query directly. It no longer uses the deprecated prometheus/global source.

Change 878858 had a related patch set uploaded (by Vgutierrez; author: Vgutierrez):

[operations/puppet@production] prometheus: Fix job:haproxy_frontend_http_responses_total:rate2m

https://gerrit.wikimedia.org/r/878858

Change 878858 merged by Vgutierrez:

[operations/puppet@production] prometheus: Fix job:haproxy_frontend_http_responses_total:rate2m

https://gerrit.wikimedia.org/r/878858

One side effect of this migration is what happens when a site is unreachable by Thanos (h/t @Vgutierrez). e.g. on https://grafana.wikimedia.org/d/000000479/cdn-frontend-traffic the other day when eqsin was unreachable then the site also disappeared from the dropdown; this is due to the fact that we're populating the dropdown based on site label from Thanos, therefore if Thanos can't reach out to eqsin then the site isn't returned.

The current behavior is counter intuitive (to me at least) as in, the site should be at least selectable and maybe no data is shown if metrics are not queryable/available.

One side effect of this migration is what happens when a site is unreachable by Thanos (h/t @Vgutierrez). e.g. on https://grafana.wikimedia.org/d/000000479/cdn-frontend-traffic the other day when eqsin was unreachable then the site also disappeared from the dropdown; this is due to the fact that we're populating the dropdown based on site label from Thanos, therefore if Thanos can't reach out to eqsin then the site isn't returned.

The current behavior is counter intuitive (to me at least) as in, the site should be at least selectable and maybe no data is shown if metrics are not queryable/available.

For site specifically what we could do is export a "fixed" metric from puppet with the list of sites, similarly to what we do for "info" metrics. This way the metric will always be available from eqiad and codfw

Change 921248 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] prometheus: remove global rules

https://gerrit.wikimedia.org/r/921248

Change 921347 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] prometheus: soft-disable 'global' instance

https://gerrit.wikimedia.org/r/921347

Change 921349 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] prometheus: de-provision 'global' instance

https://gerrit.wikimedia.org/r/921349

Change 921350 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] prometheus: remove 'global' instance references

https://gerrit.wikimedia.org/r/921350

Change 922477 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] grafana: remove varnish-aggregate-client-status-codes

https://gerrit.wikimedia.org/r/922477

Change 922499 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] icinga: remove swift alerts, moved to alertmanager

https://gerrit.wikimedia.org/r/922499

Change 922499 merged by Filippo Giunchedi:

[operations/puppet@production] icinga: remove swift alerts, moved to alertmanager

https://gerrit.wikimedia.org/r/922499

Change 861826 merged by Filippo Giunchedi:

[operations/puppet@production] prometheus: deprecate traffic 'global' rules

https://gerrit.wikimedia.org/r/861826

Change 921347 merged by Filippo Giunchedi:

[operations/puppet@production] prometheus: soft-disable 'global' instance

https://gerrit.wikimedia.org/r/921347

Change 922477 merged by Filippo Giunchedi:

[operations/puppet@production] grafana: remove varnish-aggregate-client-status-codes

https://gerrit.wikimedia.org/r/922477

Change 921248 merged by Filippo Giunchedi:

[operations/puppet@production] prometheus: remove global rules

https://gerrit.wikimedia.org/r/921248

Change 922534 had a related patch set uploaded (by Cwhite; author: Cwhite):

[operations/puppet@production] profile: remove varnish-aggregate-client-status-codes resource

https://gerrit.wikimedia.org/r/922534

Change 922534 merged by Filippo Giunchedi:

[operations/puppet@production] profile: ensure varnish-aggregate-client-status-codes absent

https://gerrit.wikimedia.org/r/922534

Change 921349 merged by Filippo Giunchedi:

[operations/puppet@production] prometheus: de-provision 'global' instance

https://gerrit.wikimedia.org/r/921349

Change 924055 had a related patch set uploaded (by Filippo Giunchedi; author: Filippo Giunchedi):

[operations/puppet@production] prometheus: don't enable server when absenting

https://gerrit.wikimedia.org/r/924055

Change 924055 merged by Filippo Giunchedi:

[operations/puppet@production] prometheus: don't enable server when absenting

https://gerrit.wikimedia.org/r/924055

Change 921350 merged by Filippo Giunchedi:

[operations/puppet@production] prometheus: remove 'global' instance references

https://gerrit.wikimedia.org/r/921350

fgiunchedi changed the task status from Open to Stalled.May 30 2023, 8:11 AM
fgiunchedi updated the task description. (Show Details)

Puppet bits are gone, I'll remove the global LV in a couple of days just out of caution

Mentioned in SAL (#wikimedia-operations) [2023-06-01T09:18:29Z] <godog> remove lv prometheus-global - T288196

fgiunchedi claimed this task.
fgiunchedi updated the task description. (Show Details)

The prometheus global instance is gone

Change 951882 had a related patch set uploaded (by Cwhite; author: Cwhite):

[operations/puppet@production] grafana: ensure prometheus/global instances removed

https://gerrit.wikimedia.org/r/951882

Change 951882 merged by Cwhite:

[operations/puppet@production] grafana: ensure prometheus/global datasources removed

https://gerrit.wikimedia.org/r/951882