Skip to content

feat(0056): route ops alarms to prices' own Slack channel via Chatbot#98

Merged
karczuRF merged 2 commits into
developfrom
feat/0056-slack-chatbot-ops-alarms
Jul 8, 2026
Merged

feat(0056): route ops alarms to prices' own Slack channel via Chatbot#98
karczuRF merged 2 commits into
developfrom
feat/0056-slack-chatbot-ops-alarms

Conversation

@karczuRF

@karczuRF karczuRF commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Wires task 0056's prices-{env}-ops-alarms topic to Slack via AWS Chatbot, matching how BE routes its own CloudWatch alarms. Follow-up to the merged PR #97; answers "what ops address?" — BE has no ops email, it uses Slack/Chatbot, so we reuse BE's existing channel rather than inventing a mailing list.

What BE does (verified in soroban-block-explorer/infra/src/lib/stacks/cloudwatch-stack.ts)

  • SNS topic ${env}-soroban-explorer-alarmsAWS Chatbot SlackChannelConfiguration → Slack.
  • Workspace/channel IDs from SSM (/soroban-explorer/{env}/slack-{workspace,channel}-id), kept out of the repo.
  • Its only "email" refs are a speculative Let's-Encrypt ACME_EMAIL, not alarm routing.

This change

  • opsAlarms.slack = { workspaceIdSsmParam, channelIdSsmParam } — new optional config (+ validation).
  • ObservabilityStack creates a SlackChannelConfiguration named prices-{env}-ops-alarms on the ops topic when the config is present, reading the IDs from SSM at deploy + a chatbot IAM role with CloudWatchReadOnlyAccess (mirrors BE).
  • production.json points at BE's existing /soroban-explorer/production/slack-* params in the shared account → prices alarms land in BE's existing ops channel. No click-to-confirm, no new mailing list. The Slack workspace is already authorized in Chatbot for BE.
  • Optional/non-breaking: omit the config to leave the topic subscriber-less (email path stays as a fallback).

Verification

cdk synth Prices-production-Observability shows AWS::Chatbot::SlackChannelConfiguration (prices-production-ops-alarms) subscribed to OpsAlarmsTopic, with SSM lookups for both IDs. tsc/eslint/prettier clean.

Deploy note

The named SSM params must exist before deploying Observability (they do — BE's alarms already depend on them); the deploy fails on the lookup otherwise. This replaces step 5's aws sns subscribe --protocol email in the operator runbook.

karczuRF added 2 commits July 8, 2026 01:36
…channel

BE has no ops email — it delivers all CloudWatch alarms to Slack through an
AWS Chatbot SlackChannelConfiguration (its ${env}-soroban-explorer-alarms
topic → Slack), with workspace/channel IDs in SSM. Match that instead of
inventing an email/mailing list for prices.

- Add optional opsAlarms.slack = { workspaceIdSsmParam, channelIdSsmParam }
  (+ validation) to the config type.
- ObservabilityStack creates a SlackChannelConfiguration named
  prices-{env}-ops-alarms on the ops topic when the config is present, reading
  the workspace/channel IDs from SSM at deploy (kept out of this public repo)
  and attaching a chatbot IAM role with CloudWatchReadOnlyAccess (mirrors BE).
- production.json points at BE's existing
  /soroban-explorer/production/slack-{workspace,channel}-id params in the
  shared account, so prices alarms land in BE's existing ops channel — one
  surface, no click-to-confirm, no new mailing list. Workspace already
  authorized in Chatbot for BE.
- Config is optional/non-breaking: omit to leave the topic subscriber-less.
  The email path (notificationEmail / aws sns subscribe) stays as a fallback.

Synth-verified (SlackChannelConfiguration prices-production-ops-alarms →
OpsAlarmsTopic, SSM lookups for both IDs); tsc/eslint/prettier clean.
Point opsAlarms.slack at prices-owned SSM params
(/prices/{env}/slack-{workspace,channel}-id) so alarms land in the
dedicated #stellar-prices-api-bot channel rather than BE's ops channel,
on the same shared Slack workspace (no Chatbot re-auth). Add addOkAction
to all 7 alarms so recoveries notify alongside breaches.

Deployed to production and smoke-tested: forcing ledger-processor-errors
ALARM->OK posted both a breach and a recovery to the channel.
@karczuRF karczuRF changed the title feat(0056): route ops alarms to Slack via Chatbot (reuse BE's channel) feat(0056): route ops alarms to prices' own Slack channel via Chatbot Jul 8, 2026
@karczuRF

karczuRF commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Updated: routes to prices' own channel, not BE's, and deployed + verified.

  • Repointed opsAlarms.slack at prices-owned SSM params /prices/production/slack-{workspace,channel}-id (per the SSM ownership split) instead of BE's /soroban-explorer/... params. Same shared Slack workspace (T83HLEDJN, already authorized in Chatbot → no re-auth), separate channel #stellar-prices-api-bot (C0BFWLMFQ9G).
  • Added addOkAction to all 7 alarms so recoveries notify alongside breaches.
  • Deployed Prices-production-Observability + smoke-tested: forcing prices-production-ledger-processor-errors ALARM→OK posted both a 🚨 breach and a ✅ recovery to #stellar-prices-api-bot.

Note: AWS Chatbot management API is us-east-2-only (describe-slack-channel-configurations --region us-east-2); the resource itself lives in eu-central-1.

@karczuRF karczuRF merged commit 8827785 into develop Jul 8, 2026
3 checks passed
@karczuRF karczuRF deleted the feat/0056-slack-chatbot-ops-alarms branch July 8, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant