Part of the Ping-Tower uptime monitoring system. 📖 Full project description and architecture →
Status lifecycle worker. Evaluates each ping result against failure and
latency thresholds, tracks per-server state in Redis, and publishes status
transitions (up ↔ down) for the API to pick up.
C# / .NET Worker Service (net10.0), layered
Domain → Application → Infrastructure, RabbitMQ.Client,
StackExchange.Redis
q.state-elevator.server-events ──▶ [ State Elevator ] ◀── q.state-elevator.ping-events
(server config) │
Redis (consecutive
failures, current
status; TTL = 3× interval)
│
▼
statusEventsExchange ──▶ q.api.status-events
- Consumes server config snapshots from
serverEventsExchangeand raw ping results frompingEventsExchange. - Checks each result against
FailureThreshold/LatencyThresholdMs; Redis holds consecutive-failure counts and current status per server (key prefixstate-elevator:, state TTL = 3× the ping interval). - On a state change, publishes to
statusEventsExchangewith routing keyserver.status.changed, consumed by the API (which updates PostgreSQL and pushes the update to the frontend via SignalR).
cp .env.example .env
docker compose up --buildKey environment variables (.env.example): STATE_ELEVATOR_RABBITMQ_*
(broker connection, exchange/queue names, status routing key),
STATE_ELEVATOR_REDIS_* (connection, database index, key prefix).
dotnet test src/tests/UnitTests
dotnet test src/tests/IntegrationTests.gitlab-ci.yml: build (Docker image, push, main/stage only) →
deploy (SSH, docker compose pull && up -d).