Skip to content

The UptimeKit Worker is a high-performance, lightweight monitoring agent built in Go. It acts as the "distributed" part of the UptimeKit ecosystem.

License

Notifications You must be signed in to change notification settings

uptimekit/worker

UptimeKit Worker (Go)

The UptimeKit Worker is a high-performance, lightweight monitoring agent built in Go. It acts as the "distributed" part of the UptimeKit ecosystem, responsible for executing health checks and reporting performance metrics back to the UptimeKit Dashboard.

What is UptimeKit?

UptimeKit is an open-source, self-hosted uptime monitoring platform. It provides a beautiful dashboard to track the availability and response times of your websites, APIs, and servers in real-time.

The Role of the Worker

While the dashboard provides the UI and data storage, the Worker does the heavy lifting:

  • Distributed Checks: Deploy multiple workers in different geographic regions to monitor latency and availability from multiple perspectives.
  • High Performance: Written in Go, the worker uses goroutines to perform hundreds of concurrent checks with minimal resource footprint.
  • Heartbeat Protocol: Automatically pulls monitor configurations from the dashboard and pushes results back securely.

Supported Monitors

The worker supports a variety of check types:

  • HTTP/HTTPS: Standard website and API availability checks.
  • TCP: Connect to any port (e.g., SMTP, SSH, Redis).
  • ICMP/Ping: Network-level connectivity testing.
  • Keyword Detection: Search for specific text in the response body.
  • HTTP JSON: Validate specific JSON fields in the response.

Getting Started

1. Requirements

2. Configuration

The worker is configured via environment variables or a .env file.

Variable Description Default
WORKER_API_KEY API key generated in your UptimeKit Dashboard. (required)
DASHBOARD_URL The URL of your UptimeKit instance. http://localhost:3000
CHECK_INTERVAL Frequency (in seconds) to pull new monitor updates. 60

3. Run with Docker

docker run -d \
  -e WORKER_API_KEY=your_key \
  -e DASHBOARD_URL=https://your-uptimekit.com \
  uptimekit/worker:latest

4. Build from Source

# Clone the repository
git clone https://github.com/uptimekit/worker.git
cd worker

# Run directly
go run ./cmd/worker

# Or build the binary
go build -o worker ./cmd/worker
./worker

Architecture

  1. Dashboard publishes monitoring tasks.
  2. Worker fetches tasks via the /heartbeat API.
  3. Worker executes checks (HTTP, TCP, etc.) concurrently.
  4. Worker sends performance data and status changes back via the /push-events API.

Part of the UptimeKit project.

About

The UptimeKit Worker is a high-performance, lightweight monitoring agent built in Go. It acts as the "distributed" part of the UptimeKit ecosystem.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks