The generic alert was correct and useless

Twelve per-partner DNS alerts became four generic ones, and five hours later they were twelve again for a reason that has nothing to do with Prometheus.

Monitoring

CW-3455 looked like straightforward consolidation (twelve blocks into four). The DNS service for roaming partners had moved off BIND and onto CoreDNS, so the alerts had to follow, and the old set was twelve near-identical blocks — six per partner, each naming a job like prometheus-site-c-dns-<partner> and a bind_* metric. Four alerts cover the same ground if the selector does the work:

sum by (job, instance) (rate(coredns_dns_requests_total{job=~"wireless-apn-dns-.*"}[10m])) == 0

With description: "APN DNS requests have dropped to 0 for {{ $labels.job }} on {{ $labels.instance }}", a new partner deployment is covered the moment its job name matches the pattern. Twelve alerts down to four (six per partner, two partners), no per-partner maintenance, and the page still names the server.

Where that falls apart

The page did not name the server. Opsgenie's notification template renders from .CommonAnnotations — the intersection of annotations across every firing alert in the group. A description built from $labels.job resolves to one string per alert, the strings differ, and the common set is empty (literally {}). The alert fired correctly; the page said nothing about which of five DNS containers (one per partner deployment) had stopped answering.

The fix, committed five hours later the same day (13:48 to 19:04), is the opposite of consolidation. One alert per job, with the hostname and the service name written into the description as literal text:

  <Partner>_DNS_Requests_Drop:
    description: "<Partner> DNS requests have dropped to 0 on <host> (wireless-apn-dns-<partner>)"
    destination: "opsgenie"
    prometheus_expression: 'sum by (job, instance) (rate(coredns_dns_requests_total{job="wireless-apn-dns-<partner>"}[10m])) == 0'
    prometheus_for: "5m"

110 lines added, 13 removed (a net gain of 97 on a consolidation ticket). The commit also leaves the condition for undoing it in a comment above the block — once infra fixes _opsgenie__description to iterate .Alerts.Firing, these can be collapsed back to generic wireless-apn-dns-.* alerts. That comment is pasted twice in the file (twice in the same block), which I have not fixed and probably should.

The general shape is worth keeping. Templating in an alert description is only as good as the weakest renderer downstream (here, one Go template in another team's repository). Alert text is not the place to discover a renderer's aggregation rules.

The other reformat that had to be undone

CW-2568 was the larger piece of work: every xcore_* expression in both files needed job="partner-d_federate" added, because those series arrive by Prometheus federation and more than one job can carry the same series name — a sum() without a job selector quietly adds the same PGW twice. 303 changed lines in meta-prod.yml and 38 in meta-dev.yml, in one commit (28 July 2025).

That pass did two things at once (one necessary, one not). It added the job selector, and it expanded every expression from a single quoted line into a YAML block scalar:

    prometheus_expression: |-
      (
        sum(
          avg_over_time(
            xcore_sgw_count{qip=~"172\\.22\\.120\\.(6|7)"}[5m]
          )
        )
      ) < 0.85

Two weeks later the whole reformat came back out under the subject Fix yaml and multi line prometheus — 42 lines in, 328 lines out, every block scalar collapsed to one quoted string again. I have no record of which consumer objected, only that something did. The lesson is cheaper than the commit: a semantic change and a formatting change in the same pass cannot be reverted separately, and the formatting is always the part you have to give back.

The net effect across the branch was smaller than the diff suggests. meta-prod.yml went from 1,359 lines to 1,269, and from 124 alerts to 115 — nine alerts deleted (not the wholesale cleanup a line count implies).

Names outlive the thing they name

One alert still carried Partner D's name in its own key, and by March 2026 the containers it watched had little to do with that vendor. CW-3571 renamed it to WirelessTankersContainerDown and widened the selector in the same commit (three lines, both files); a second commit added the container name and instance to the description. The interesting part is the reason an alert keeps a vendor's name for two years — nothing breaks, so nobody looks.

What the CI side cost

Moving the deploy off Jenkins was four lines deleted and twenty-five added (CW-3329, February 2026). The useful commit came afterwards — workflow_dispatch, because the new workflow had no manual trigger and the only way to rerun it was to push. The other tuning from that week was one number — a partner's DNS alert sampling window widened from 5m to 10m, which is the whole of CW-3329 that anyone remembers.

Since then the file has mostly shrunk. A GTP proxy refactor took 95 lines out and put 6 back; the ping failure-rate alerts went entirely, 36 lines, with nothing replacing them. 295 alerts in production now, 209 of them paging (86 to Slack, no third tier). The direction of travel is fewer alerts with more words in them.