Agent Skills › supercheck-io/supercheck › supercheck-monitoring-alerts

supercheck-monitoring-alerts

GitHub

管理Supercheck监控与告警,涵盖HTTP/SSL等检查执行、区域聚合、状态机及多通道通知。支持事件创建、自动恢复、UI展示及SSRF安全策略,确保分布式调度的可靠性与数据一致性。

.agents/skills/monitoring-alerts/SKILL.md supercheck-io/supercheck

Trigger Scenarios

配置或修改监控项(如HTTP、Ping、Playwright) 排查告警误报或漏报问题 处理监控事件的生命周期(创建、恢复、重新打开) 调试通知渠道或聚合逻辑异常

Install

npx skills add supercheck-io/supercheck --skill supercheck-monitoring-alerts -g -y
More Options

Non-standard path

npx skills add https://github.com/supercheck-io/supercheck/tree/main/.agents/skills/monitoring-alerts -g -y

Use without installing

npx skills use supercheck-io/supercheck@supercheck-monitoring-alerts

指定 Agent (Claude Code)

npx skills add supercheck-io/supercheck --skill supercheck-monitoring-alerts -a claude-code -g -y

安装 repo 全部 skill

npx skills add supercheck-io/supercheck --all -g -y

预览 repo 内 skill

npx skills add supercheck-io/supercheck --list

SKILL.md

Frontmatter
{
    "name": "supercheck-monitoring-alerts",
    "description": "Work on Supercheck HTTP request, website\/SSL, ping host, port check, or Playwright synthetic monitors, wrong monitor status or uptime (false down, missing regions), check cycles, regional scheduling and aggregation, alert thresholds, state and history, incidents, or email, Slack, webhook, Telegram, Discord, and Microsoft Teams notifications."
}

Supercheck monitoring and alerts

flowchart LR
  SCHED[Distributed monitor scheduler] --> Q[Regional queues]
  Q --> CHECK[HTTP, website, ping, port, or synthetic execution]
  CHECK --> AGG[Regional aggregation]
  AGG --> STATE{Alert state machine}
  STATE --> HIST[Alert history]
  STATE --> NOTIFY[Notification providers]

Start here

File Why
worker/src/monitor/monitor.service.ts Check execution per monitor type; SSRF-safe probes via requestPinnedMonitorTarget (common/utils/pinned-monitor-request.ts); cycle arrival recording
worker/src/monitor/monitor-evaluator.ts Threshold, transition, and alert logic (evaluateAndSendAlert)
app/src/lib/monitor-cycles.ts, worker/src/monitor-control/ (cycle-policy.ts, monitor-cycle.service.ts, monitor-cycle.processor.ts) Durable check cycles: regional quorum, closing, aborting
app/src/lib/monitor-aggregation-service.ts Regional rollup and uptime
worker/src/notification/notification.service.ts, app/src/db/schema/notification.ts Providers, delivery, alert history

Monitor definition and execution

  • Monitor definitions are tenant-owned configuration; executions and regional results are immutable observations.
  • Preserve target, type, request/check config (method, headers/body, auth, timeouts, expected status/keywords, SSL checks), synthetic test reference, frequency, location selection, alert thresholds/flags, muted state, enabled state, and notification relationships across schema, APIs, UI, scheduler, queue, and worker. Monitor retryStrategy is deprecated and ignored.
  • Monitor destinations are untrusted. Validate URL shape at configuration time; enforce SSRF-safe DNS-pinned resolution at execution time, re-applied on every redirect and against DNS changes.
  • Scheduling is safe across multiple app replicas via BullMQ repeatable monitor jobs keyed by a stable jobId, with a Redis NX lock guarding startup re-scheduling (app/src/lib/monitor-scheduler.ts). Restarts or overlapping ticks must not duplicate dispatch.
  • Location selection maps deterministically to worker queues and rejects unknown/unavailable locations deliberately.

Aggregation

  • A regional result and aggregate monitor state are separate. Never infer global health from one region.
  • Define how missing, late, timed-out, and conflicting regional results affect aggregate status; preserve that rule across dashboards, APIs, and alert evaluation. Cycle status is open, closed, or aborted (app/src/db/schema/monitor-cycles.ts), and the work is split:
    • decideMonitorCycle in worker/src/monitor-control/cycle-policy.ts computes the regional quorum decision only.
    • MonitorCycleService.closeCycle (monitor-cycle.service.ts) applies it: monitor status, synthetic missing-region results, and alert evaluation.
    • monitor-cycle.service.ts aborts cycles for paused or disabled monitors. An aborted cycle writes no synthetic failures, so it does not count against uptime.
    • monitor-cycle.processor.ts backs off and retries closure when a dependency check is temporarily unavailable, instead of failing the cycle.
    • recordCycleArrival in worker/src/monitor/monitor.service.ts treats a cycle owned by another monitor as absent, and a result for a closed or aborted cycle never re-evaluates it.
  • Use consistent units and boundaries for latency, uptime, thresholds, and time windows.
  • Store enough immutable evidence to explain why an alert transitioned without retaining secrets or unrestricted response bodies.

Alert state and history

  • Model transitions explicitly using the current states and consecutive-failure/recovery policy.
  • Persist state transitions with the result that caused them; alert_history records each delivery attempt (provider, status, outcome).
  • Deduplicate repeated failing observations while preserving meaningful reminders/escalations configured by the product.
  • Recovery closes the active condition once (one recovery alert per outage); failure reminders back off exponentially and are capped at 3 per sequence.
  • Alerts open incidents: a sent or failed (not pending) alert_history row is queued for app/src/sre/lib/background-alert-triage.ts, which opens or joins one incident per monitor or job. alertConfig carries incidentEnabled (default on), incidentSeverity (auto or sev1-sev4) and autoResolveIncident (default on); a recovery resolves the open auto-opened incident when it is on, even if recovery alerts are off. Only SRE_ENABLED is needed; SRE_AUTOMATION_ENABLED gates AI triage. Keep these fields in sync across the app schema, worker, CLI schema, MCP tools and OpenAPI.
  • Alert acknowledgement is not implemented; incident acknowledgement is (see the SRE operations skill). Manual status changes require permission, tenant scope, audit events, and race-safe updates.

Notification providers

  • Provider definitions (email, Slack, webhook, Telegram, Discord, Teams; webhook presets for PagerDuty, Opsgenie, Splunk On-Call, Better Stack, and incident.io) are scoped to their owning tenant and secrets remain encrypted/redacted.
  • Render messages from bounded, escaped data. Do not leak headers, variables, tokens, raw response bodies, or internal errors.
  • Delivery uses bounded timeouts with provider-appropriate retry behavior (Slack, Telegram, Discord, and Teams retry; webhook and email are single-attempt today).
  • Webhook destinations use SSRF protection (allowlisted hosts, DNS pinning). Notification delivery is strictly outbound; no inbound callback route exists.
  • Record delivery outcome and safe provider diagnostics without blocking the monitor’s terminal persistence indefinitely.

Verify

  • Unit-test threshold boundaries, state transitions, deduplication, recovery, and partial/missing region behavior.
  • Integration-test scheduler ownership, queue routing, worker output, and provider retry/idempotency.
  • Test cross-tenant provider/monitor access and secret redaction.
  • Use disposable provider endpoints and clean them up; live delivery acceptance remains separate from automated tests.

Version History

  • 8a9bade Current 2026-11-03 04:16

    新增从告警创建和解决事件的功能,优化事件详情页、通知页面及邮件模板;修复时区导致的自动恢复错误及SQL时序问题,增强告警去重与恢复逻辑的准确性。

  • 974a753 2026-09-22 16:21

Same Skill Collection

.agents/skills/architecture/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/data-storage/SKILL.md
.agents/skills/execution-engine/SKILL.md
.agents/skills/feature-implementation/SKILL.md
.agents/skills/infrastructure-deployment/SKILL.md
.agents/skills/integrations-extensions/SKILL.md
.agents/skills/mcp-server/SKILL.md
.agents/skills/platform-features/SKILL.md
.agents/skills/security-auth/SKILL.md
.agents/skills/sre-operations/SKILL.md
.agents/skills/testing-qa/SKILL.md
.agents/skills/ui/SKILL.md
.github/skills/code-review/SKILL.md
.github/skills/docker-compose-deployment/SKILL.md
.github/skills/feature-implementation/SKILL.md

Metadata

Files
0
Version
8a9bade
Hash
447eb679
Indexed
2026-09-22 16:21

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 10:05
浙ICP备14020137号-1