Skip to content

bench: deliver soak alarms and reaper notices to Slack via AWS Chatbot - #4733

Merged
prakhargarg105 merged 10 commits into
mainfrom
con-179-slack-alerts
Sep 1, 2026
Merged

bench: deliver soak alarms and reaper notices to Slack via AWS Chatbot#4733
prakhargarg105 merged 10 commits into
mainfrom
con-179-slack-alerts

Conversation

@prakhargarg105

@prakhargarg105 prakhargarg105 commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

What

Observability delivery for the soak pipeline's two SNS topics and CloudWatch metrics:

  1. Slack via AWS Chatbot (terraform/persistent/slack.tf): channel configuration bound to both topics (soak alarms + orphan reaper), guardrailed to CloudWatchReadOnlyAccess. Workspace/channel IDs are committed defaults (not secrets; mirrors backend.hcl's account-specific values) and are required by validation — Slack is the only Terraform-managed alert channel.
  2. Reaper messages get an SNS per-protocol envelope (cleanup-lambda/sweep.go): Chatbot silently drops plain SNS text, so the default protocol carries Chatbot's custom-notification schema while email keeps the human-readable summary. Pinned by TestSweep_PublishUsesPerProtocolEnvelope.
  3. Email backups are manual, out-of-band SNS subscriptions (documented in SOAK.md for BOTH topics): no address belongs in the repo and a TF_VAR-gated subscription self-destructs on env-less re-applies, so the safest email subscription is one Terraform can't touch. The pre-existing subscription is preserved via a removed block (state forget, not destroy).
  4. Alarm descriptions rewritten for the reader who gets paged: plain language, first diagnostic step, runbook pointer, full issue URLs instead of bare #4648-style numbers.
  5. Importable Grafana dashboard (benchmarking/aws/grafana/soak-dashboard.json): connector/scenario template dropdowns via dimension discovery, alarm thresholds drawn in, CloudWatch alarm annotations, RunActive overlay. Binds to any CloudWatch data source at import time (bench-account data source requested from the Grafana admins separately).

Validated live

Both message shapes confirmed rendering in #soak-redpanda-connect (alarm card with graph via a synthetic set-alarm-state, reaper custom notification via a test publish). Real-state plan for the final Terraform: 3 pure state moves, 0 add/change/destroy.

🤖 Generated with Claude Code

terraform/persistent/slack.tf binds a Chatbot Slack channel configuration
to both SNS topics (soak alarms + orphan reaper), gated on
TF_VAR_slack_workspace_id / TF_VAR_slack_channel_id so the stack applies
before the one-time console OAuth is done. The channel's guardrail and
role are CloudWatchReadOnlyAccess — enough to render alarm cards, no
mutation surface.

Email becomes the optional backup subscriber (empty default), with a
cross-variable validation ensuring at least one channel is always
configured — an apply with neither fails loudly instead of leaving alarms
silently unrouted.

Chatbot silently drops plain SNS text, so the reaper now publishes an SNS
per-protocol envelope: email subscribers keep the human-readable summary,
everything else gets Chatbot's custom-notification schema. Pinned by
TestSweep_PublishUsesPerProtocolEnvelope.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread benchmarking/aws/terraform/persistent/slack.tf Outdated
Comment thread benchmarking/aws/SOAK.md Outdated
Comment thread benchmarking/aws/cleanup-lambda/sweep.go Outdated
The descriptions render verbatim in the Slack alarm card, where bare
issue numbers (#4648) and class jargon meant nothing to a responder.
Each now leads with what happened in plain language, gives the first
diagnostic step, points at the runbook, and links past examples as full
URLs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread benchmarking/aws/SOAK.md Outdated
Review fixes for the Slack alerting PR:

- The Slack workspace/channel IDs become committed variable defaults
  (they're not secrets — both appear in every Slack URL), mirroring
  backend.hcl's account-specific values. Count-gating on ambient TF_VAR_*
  meant any re-apply whose shell didn't re-export them silently DESTROYED
  the channel configuration — and SOAK.md's own add-a-connector step
  documented exactly that invocation. Passing both as "" remains the
  explicit disable, still guarded by the at-least-one-channel validation.

- perProtocolMessage's defensive fallback returned raw text that the
  caller then published with MessageStructure=json — which SNS rejects,
  losing the notice entirely. It now returns an error and the caller
  publishes plain text WITHOUT the structure flag (email-only delivery
  beats a rejected publish).

- SOAK.md's add-a-connector step and one-time-setup bullet (plus the
  nightly workflow header and the Alerts bullet) now describe the
  committed-defaults world; the stale 'deliberately undefaulted' email
  claim is gone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread benchmarking/aws/terraform/persistent/alarms.tf Outdated
Comment thread benchmarking/aws/terraform/persistent/slack.tf Outdated
prakhargarg105 and others added 2 commits August 27, 2026 12:30
Two review findings shared a root cause: the email subscription was
count-gated on an ambient TF_VAR_* (self-destructing on any env-less
re-apply, and needing a human confirmation click to resurrect), and it
only covered the soak-alerts topic — the reaper topic had zero email
subscribers, contradicting the never-silently-unrouted claim.

A committed address default (the fix used for the Slack IDs) is not
available here: no team alias exists and a personal mailbox doesn't
belong in the repo. So email backups leave Terraform entirely: they are
documented manual subscriptions to BOTH topics (SOAK.md), which no
re-apply can unsubscribe. The pre-existing subscription is preserved as
exactly that via a removed block (state forget, not destroy).

Slack is now the ONLY Terraform-managed channel: its IDs are required by
validation (blanking them would leave both topics unrouted), and the
obsolete count gating comes off the three resources with moved blocks —
verified against real state: 3 moves, 0 add/change/destroy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Six panels over the RedpandaConnect/Bench CloudWatch namespace with
connector/scenario template dropdowns (dimension discovery — new
connectors joining the rotation appear without dashboard changes), the
three alarm thresholds drawn as lines, CloudWatch alarm-state
annotations, and a RunActive overlay so absence-of-run reads differently
from failure. Binds to any CloudWatch data source via a variable at
import time; the bench account's data source is being requested from the
Grafana admins separately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread benchmarking/aws/grafana/soak-dashboard.json Outdated
Comment thread benchmarking/aws/SOAK.md Outdated
prakhargarg105 and others added 2 commits August 31, 2026 12:27
…dering

Re-encode all panel targets with explicit queryMode: Metrics /
metricQueryType: 0 / metricEditorMode: 0 / matchExact: false — the
legacy encoding made Grafana fall back to the data source's default
(non-us-east-2) region, rendering every panel as NO DATA. Default the
time range to now-7d since soaks run nightly, and set
insertNulls: 3600000 so separate runs render as disconnected segments
instead of being joined by interpolated lines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A rewrite left it dangling at the end of the Grafana bullet, reading as
if the three channels were a property of the dashboard.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread benchmarking/aws/grafana/soak-dashboard.json Outdated
The panel drew its red line at 2097152 while the rss-slope alarm fires
at 2000000, so a leak between the two paged while rendering below the
line. Match the alarm's decimal threshold and say MB in the
description.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread benchmarking/aws/SOAK.md Outdated
Leftover from when the subscription was Terraform-managed; the manual
`aws sns subscribe` sentence above already covers confirmation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread benchmarking/aws/SOAK.md Outdated
…t above

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread benchmarking/aws/SOAK.md
Comment thread benchmarking/aws/terraform/persistent/slack.tf
@prakhargarg105
prakhargarg105 merged commit 665fdf7 into main Sep 1, 2026
10 of 11 checks passed
@prakhargarg105
prakhargarg105 deleted the con-179-slack-alerts branch September 1, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants