Skip to content

Alert in Discord when the Actions collector goes silent in Loki - #6567

Merged
backspace merged 2 commits into
mainfrom
cs-13575-actions-collector-loki-silence-alert
Oct 8, 2026
Merged

backspace merged 2 commits into
mainfrom
cs-13575-actions-collector-loki-silence-alert

Conversation

@backspace

Copy link
Copy Markdown
Contributor

Important

Merge after cardstack/infra#753 is applied, including its SSM parameter and grant. This PR's staging apply workflow reads /staging/boxel-grafana/discord_alarms_webhook, and fails with AccessDenied before that.

Background and Goal

The GitHub Actions Queue dashboard was empty from 2026-10-04 until a redeploy on 2026-10-06: the collector's log router had stopped sending to Loki, and nothing reported it. This PR adds a staging alert that fires when Loki receives no collector lines for ten minutes, and posts it to the alarms-staging-internal Discord channel. cardstack/infra#753 has the log-router fix.

Where to start

  • provisioning/alerting-hosted/staging/rules/actions-collector-group.json: the rule. No lines gives "no data", not zero, so noDataState is Alerting. It routes to Discord through notification_settings.receiver; the default notification policy does not change.
  • scripts/apply-alerting.sh: now pushes provisioning/alerting-hosted/<env>/ too, contact points first (created or replaced by uid), then rule groups.

Key decisions and non-obvious mechanics

  • alerting-hosted/<env>/ is for what exists in one hosted environment only. The collector runs in staging only, so this rule would always fire in production. docker-compose does not mount the directory, so local Grafana never sees a rule whose contact point it lacks.
  • The webhook URL is a credential. The contact point file has ${DISCORD_ALARMS_WEBHOOK}, which the staging workflow reads from SSM. On an error, the script prints only the server's message, not the request body.
  • Tested against a local Grafana 12.4.3 and Loki 3.4.4: the contact point is created, then replaced on a second run; the rule routes to it; the rule is pending (alerting) with no lines and inactive with lines; a missing DISCORD_ALARMS_WEBHOOK fails the apply.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QZtQde6na3jLiKVjAavLPz

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T15:09:45.376914Z 72bdf57 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 72bdf573f5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/observability/scripts/apply-alerting.sh Outdated
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Host Test Results

    1 files      1 suites   1h 19m 21s ⏱️
5 207 tests 5 196 ✅ 11 💤 0 ❌
5 222 runs  5 211 ✅ 11 💤 0 ❌

Results for commit dcd2a42.

Realm Server Test Results

    1 files    319 suites   2h 7m 35s ⏱️
5 102 tests 5 102 ✅ 0 💤 0 ❌
5 161 runs  5 161 ✅ 0 💤 0 ❌

Results for commit dcd2a42.

@backspace
backspace requested a review from a team October 7, 2026 15:02
backspace and others added 2 commits October 8, 2026 03:25
Add a staging alert rule that fires when Loki receives no lines from the
GitHub Actions queue collector for ten minutes. It posts to the
alarms-staging-internal Discord channel through a new contact point.

apply-alerting.sh now also pushes provisioning/alerting-hosted/<env>/:
contact points first, then rule groups. The local stack does not mount
that directory. The contact point gets its webhook URL from SSM, through
the staging apply workflow, so the URL is not in this repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QZtQde6na3jLiKVjAavLPz
apply-alerting.sh found an unset ${VAR} only when it reached the group
that used it. A missing DISCORD_ALARMS_WEBHOOK therefore failed after
apply.sh had already pushed dashboards and data sources, and after any
earlier alert files.

apply-alerting.sh now reads every ${VAR} in the files it will push for
the env, and names all unset ones before it pushes anything. With
--preflight it only makes that check. apply.sh runs the preflight with
its other prerequisite checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QZtQde6na3jLiKVjAavLPz
@backspace
backspace force-pushed the cs-13575-actions-collector-loki-silence-alert branch from d4cc8ca to dcd2a42 Compare October 8, 2026 08:25
@backspace
backspace merged commit ec1568a into main Oct 8, 2026
92 checks passed
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.

2 participants