Page MenuHomePhabricator

WDQS graph split: cleanup monitoring/alerting now that we are in production
Closed, ResolvedPublic

Description

Apologies for the vagueness of this task, I wanted to get something into Phab before I forgot.

Per IRC conversation with @Dzahn, we have alerts firing for the WDQS categories service on the new graph split hosts .

I also accidentally triggered a page for all SREs earlier today while doing work on wdqs-main. I've since merged a patch to stop the paging , but we should probably look closely at the state of monitoring since wdqs-main and wdqs-scholarly are now in production.

Creating this ticket to

  • Compare current wdqs-main and wdqs-scholarly monitors to the pre-graph-split wdqs monitoring.
  • Make appropriate changes to any and all related monitoring/alerting.

Details

Other Assignee
RKemper

Event Timeline

One piece of the puzzle here is that some/most checks are in Icinga while others are in prometheus.

https://icinga.wikimedia.org/cgi-bin/icinga/status.cgi?search_string=Categories+update

https://icinga.wikimedia.org/cgi-bin/icinga/status.cgi?search_string=wdqs

The "Status: Unknown" combined with "NRPE: Unable to read output" usually means that the nagios-nrpe-server process on the affected machines crashed and needs a restart.

This is common when machines run out of RAM and then oom-killer just likes to kill NRPE first.

So I suggest first do a sudo systemctl restart nagios-nrpe-server on those machines with the "unknown" alerts first and see if that resolves them.

If that's the case maybe what is happening is that the data transfer cookbook caused machines to be out of RAM .. or something else.

Separate from that there is also the part about notifications.

For some reason Icinga stopped sending emails (T253733) quite some time ago and unless you have custom notification methods in Icinga that probably means the only place where alerts happen is on IRC in the -operations channel. Which likely means it's not very effective at actually alerting specific people.

Some possible fixes could be:

  • create a contact in Icinga config using a team or list email address
  • configure Icinga checks to associate this contact with existing checks
  • migrate checks from Icinga to Prometheus / alert_manager (possible for http(s) checks but likely not for things like process checks via NRPE)
  • for existing and hypothetically migrated checks:
    • use existing or add new receiver together with prometheus::blackbox::http checks
    • configure this receiver to send mail to a list or team address and / or to create Phabricator tickets as notification method

The latter can be copied for example from the sre-collab team setup.

Gehel triaged this task as Medium priority.Sep 6 2024, 12:23 PM
Gehel moved this task from Incoming to Scratch on the Data-Platform-SRE board.
bking updated Other Assignee, added: RKemper.
bking changed the task status from Open to In Progress.Sep 12 2024, 10:22 PM

Per today's pairing session, we determined that the nagios monitor on the graph split hosts runs /usr/local/lib/nagios/plugins/check_categories.py --lag .

On a working host, the output looks like this:
`root@wdqs2019:/etc/nagios/nrpe.d# /usr/local/lib/nagios/plugins/check_categories.py --lag
OK - Categories lag: 17:14:31.687516
`

Whereas on the broken (graph split) hosts, the output looks like this:

root@wdqs2021:~# /usr/local/lib/nagios/plugins/check_categories.py --lag
Traceback (most recent call last):

File "/usr/local/lib/nagios/plugins/check_categories.py", line 111, in <module>
  sys.exit(main())
File "/usr/local/lib/nagios/plugins/check_categories.py", line 100, in main
  return check_categories_lag(
File "/usr/local/lib/nagios/plugins/check_categories.py", line 27, in check_categories_lag
  lag = extract_lag(json_response)
File "/usr/local/lib/nagios/plugins/check_categories.py", line 56, in extract_lag
  date_str = json_response['results']['bindings'][0]['mindate']['value']

KeyError: 'mindate'

It looks like categories is not actually loaded on the graph split hosts (at least, the one I checked):

root@wdqs2019:/srv/wdqs# du -hcxs categories.jnl
36G     categories.jnl
36G     total


root@wdqs2021:/srv/wdqs#  du -hcxs categories.jnl
64K     categories.jnl
64K     total

I believe we'll need to do a data-transfer or a categories load on the graph split hosts to fix this issue.

Update: Since the public categories endpoint does not route to the categories instances hosted on wdqs-main and wdqs-scholarly hosts, there is no point in loading categories as no clients will ever reach these instances.

As such, we've elected to remove the Puppet code that installs categories on the graph split hosts, and it's very likely we'll move categories to its own infrastructure (see T374016 ).

After removing the above patchset, the categories endpoint has been removed and the checks have disappeared from icinga. As such, I'm closing out this ticket.

Upon further review, it looks like there are still some lingering services related to categories on the graph split hosts:

root@wdqs2021:~# systemctl list-units | grep -i categories
  prometheus-blazegraph-exporter-wdqs-categories.service                                   loaded active running   Prometheus Blazegraph Exporter (wdqs-categories)
  wdqs-categories.service                                                                  loaded active running   Query Service - Blazegraph - wdqs-categories
  load-categories-daily.timer                                                              loaded active waiting   Periodic execution of load-categories-daily.service
  wmf_auto_restart_prometheus-blazegraph-exporter-wdqs-categories.timer                    loaded active waiting   Periodic execution of wmf_auto_restart_prometheus-blazegraph-exporter-wdqs-categories.service

I stopped the services and ran puppet:

root@wdqs2021:~# systemctl disable --now prometheus-blazegraph-exporter-wdqs-categories.service wdqs-categories.service load-categories-daily.timer wmf_auto_restart_prometheus-blazegraph-exporter-wdqs-categories.timer
root@wdqs2021:~# run-puppet-agent

Unfortunately, this left the wdqs-categories service in a failed state. Re-opening so we can figure out the best way to remove the categories service and its exporters.

Mentioned in SAL (#wikimedia-operations) [2024-09-13T16:56:14Z] <bking@cumin2002> START - Cookbook sre.hosts.downtime for 3:00:00 on wdqs[1021-1024].eqiad.wmnet with reason: T373935

Mentioned in SAL (#wikimedia-operations) [2024-09-13T16:56:31Z] <bking@cumin2002> END (PASS) - Cookbook sre.hosts.downtime (exit_code=0) for 3:00:00 on wdqs[1021-1024].eqiad.wmnet with reason: T373935

I manually removed the categories unit file and ran systemctl reset-failed on all graph split hosts, which cleared the failed categories unit and should prevent any further alerts from firing.

This is a one-off action that won't be necessary in the future, as Puppet will no longer install categories after a restart. This also means we'll need a new home for categories, as we will eventually retire all non-split WDQS hosts. But that's a discussion for another ticket ( T374016, to be specific).