MCPcopy Index your code
hub / github.com/adamdecaf/deadcheck

github.com/adamdecaf/deadcheck @v0.8.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.8.1 ↗ · + Follow
116 symbols 376 edges 27 files 2 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Deadcheck Logo

deadcheck

GoDoc Build Status Coverage Status Go Report Card Apache 2 License Docker Pulls

Deadcheck is a versatile dead man's switch designed to be independent of the infrastructure hosting it. The project allows users to set up checks that must be periodically "confirmed" to indicate that everything is fine. If a check isn't confirmed within the specified time, Deadcheck triggers a set of actions, such as sending alerts or executing tasks to ensure that the necessary steps are taken in the event you're no longer able to do so.

Deadcheck is an automated dead man's switch that doesn't rely on its own uptime. Instead, it uses external services for final triggers, ensuring alerts and actions occur even if the hosting infrastructure is down. Deadcheck relies on third parties (e.g., HealthChecks.io, PagerDuty) to handle alerts when a check is missed.

Features

  • Decoupled from Hosting Infrastructure: Deadcheck ensures that the actual execution of alerts or incidents happens independently from the infrastructure hosting it. Even if the Deadcheck server goes down, the check-in process will still trigger events using external services.
  • Configurable Check Intervals: Flexible check intervals allow you to set up switches ranging from short-term (hours) to long-term (months).
  • Provider-Agnostic Setup: Deadcheck is designed to integrate with a variety of external systems, allowing for a wide range of customization in how your dead man's switch operates.

Install

Download the latest release for your architecture.

Configuration

checks:
  - id: "hourly-sync"
    name: "Upload data every hour"
    description: "<string>"
    schedule:
      every:
        interval: "1h"
        start: "14:00"
        end: "18:00"
    # Override alert for one check
    alert:
      pagerduty:
        apiKey: "<string>"
        escalationPolicy: "<string>"

  - id: "2pm-checkin"
    name: "Reports Finalized"
    schedule:
      weekdays:
        timezone: "America/New_York"
        times:
          - "14:00"
        # Only allow check-ins between 13:55 and 14:05
        tolerance: "5m"

  - id: "5pm-close"
    name: "Close out for the day"
    schedule:
      bankingDays:
        timezone: "America/New_York"
        times:
          - "17:00"
        # Only allow check-ins between 16:55 and 17:05
        tolerance: "5m"

# Global alert configuration
alert:
  # healthchecksio:
  #   apiKey: "string"

  # pagerduty:
  #   apiKey: "<string>"
  #   escalationPolicy: "<string>"
  #   from: "<email>"

  # slack:
  #   apiToken: "<string>"
  #   channelID: "<string>"

Usage

Make an HTTP POST or PUT to deadcheck:

PUT /v1/checks/{id}/check-in
{"nextExpectedCheckIn":"2024-10-09T21:05:00Z"}

Successful response, or failure in the response.

Integrations

  • HealthChecks.io: Stable lightweight server monitoring used by thousands of companies.
  • PagerDuty: A service is used and incident created but snoozed preventing notifications. Each successful check-in pushes the snooze out into the future until the next expected check-in.
  • Slack: Schedule messages in the future which notify on failed check-ins.

Supported and tested platforms

  • 64-bit Linux (Ubuntu, Debian), macOS, and Windows

License

Apache License 2.0 - See LICENSE for details.

Extension points exported contracts — how you extend this code

Client (Interface)
(no doc) [1 implementers]
pkg/deadcheck/client.go
Client (Interface)
(no doc) [1 implementers]
internal/provider/provider.go
Client (Interface)
(no doc) [1 implementers]
internal/provider/pd/client.go
Client (Interface)
(no doc) [1 implementers]
internal/provider/slack/client.go
Client (Interface)
(no doc) [1 implementers]
internal/provider/healthchecksio/healthchecksio.go

Core symbols most depended-on inside this repo

Calculate
called by 23
internal/provider/snooze/snooze.go
CheckIn
called by 7
internal/provider/healthchecksio/healthchecksio.go
findService
called by 6
internal/provider/pd/service.go
deleteService
called by 6
internal/provider/pd/service.go
mergeAlertConfigs
called by 6
internal/check/checks.go
ReadSlackFromEnv
called by 5
internal/config/config.go
setupInitialIncident
called by 4
internal/provider/pd/incidents.go
findScheduledMessages
called by 4
internal/provider/slack/client.go

Shape

Function 48
Method 39
Struct 24
Interface 5

Languages

Go100%

Modules by API surface

internal/config/config.go16 symbols
internal/provider/slack/client.go12 symbols
internal/provider/healthchecksio/healthchecksio.go11 symbols
internal/provider/pd/client.go9 symbols
pkg/deadcheck/client.go8 symbols
internal/provider/pd/client_test.go7 symbols
internal/provider/pd/incidents.go5 symbols
internal/check/checks.go5 symbols
internal/provider/snooze/snooze_test.go4 symbols
internal/provider/provider.go4 symbols
internal/provider/pd/service.go4 symbols
internal/provider/mock.go4 symbols

For agents

$ claude mcp add deadcheck \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact