Akka Monitor is a monitoring solution for Akka.NET clusters. It provides visibility into cluster state, actor metrics, and system health.
The repository is organized as follows:
src/: Contains the source code for the main .NET application.Monitor/: The main Web API application that serves the monitoring dashboard and API.MonitorLib/: A shared library containing core logic and data structures.
monitor-cli/: A Go-based command-line interface tool for interacting with the monitor.k8s/: Kubernetes configuration files for deploying the monitor and related services (Prometheus, Grafana).Dockerfile: The Docker configuration for building the Monitor application.docker-compose.yaml: A Docker Compose file for running the application locally.
- Docker
- Docker Compose
To start the application locally using Docker Compose, run:
docker-compose up --build -dThe application will be accessible at http://localhost:8080.
To build the .NET application locally:
- Navigate to the
srcdirectory. - Run
dotnet build.
To build the Docker image manually:
docker build -t akka-monitor .Run integration tests for the Monitor API:
docker run --rm -v $(pwd):/app -w /app/src/Monitor.IntegrationTests mcr.microsoft.com/dotnet/sdk:8.0 dotnet testRun unit tests for MonitorLib:
docker run --rm -v $(pwd):/app -w /app/src/MonitorLib.Tests mcr.microsoft.com/dotnet/sdk:8.0 dotnet testRun unit tests for Monitor:
docker run --rm -v $(pwd):/app -w /app/src/Monitor.Tests mcr.microsoft.com/dotnet/sdk:8.0 dotnet testOr run all tests:
```bash
docker run --rm -v $(pwd):/app -w /app mcr.microsoft.com/dotnet/sdk:8.0 dotnet testThe monitor-cli provides a command-line interface for managing monitors and alerts.
cd monitor-cli
go build -o mctl# List all monitors
./mctl monitor list
# Create an HTTP monitor
./mctl monitor create http -n WebsiteMonitor -u https://example.com -i 60
# Create a DNS monitor
./mctl monitor create dns -n DNSMonitor -a 8.8.8.8 -i 30
# Get monitor status
./mctl monitor info -n WebsiteMonitor-Http
# List all alerts
./mctl alert list
# Create a Slack alert
./mctl alert create slack -n ProductionAlert -u https://hooks.slack.com/services/XXX -c "#alerts"
# Delete a monitor
./mctl monitor delete -n WebsiteMonitor-HttpFor detailed CLI documentation, see monitor-cli/README.md.
The Monitor API provides the following endpoints:
GET /api/v1/monitor- List all monitorsGET /api/v1/monitor/{name}- Get monitor statusDELETE /api/v1/monitor/{name}- Delete a monitorPOST /api/v1/monitor/http- Create HTTP monitorPOST /api/v1/monitor/dns- Create DNS monitor
GET /api/v1/alert- List all alertsGET /api/v1/alert/{name}- Get alert detailsDELETE /api/v1/alert/{name}- Delete an alertPOST /api/v1/alert/slack- Create Slack alert
Swagger documentation is available at http://localhost:8080/swagger when running the application.