Part of the Ping-Tower uptime monitoring system. 📖 Full project description and architecture →
Time-series ingestion worker. Consumes raw ping results from RabbitMQ and batches them into ClickHouse for fast historical queries (latency, uptime, packet loss, TLS/DNS data).
C# / .NET Worker Service (net10.0), layered
Domain → Application → Infrastructure, RabbitMQ.Client,
ClickHouse.Client, Dapper, Polly
pingEventsExchange ──▶ q.metrics-writer.ping-events ──▶ [ Metrics Writer ] ──▶ ClickHouse (server_pings)
- Consumes every ping result published by the Ping Service.
- Buffers records in memory and flushes in batches — whichever comes first:
RABBITMQ_BATCH_SIZErecords orRABBITMQ_FLUSH_INTERVAL_MSelapsed — then bulk-inserts into theserver_pingstable in ClickHouse. RABBITMQ_PREFETCH_COUNT/RABBITMQ_CHANNEL_CAPACITYbound how far the consumer can run ahead of the writer to avoid unbounded memory growth.
cp .env.example .env
docker compose up --buildKey environment variables (.env.example): RABBITMQ_* (broker
connection, queue, batch size, flush interval, prefetch/channel capacity),
CLICKHOUSE_CONNECTION_STRING.
.gitlab-ci.yml: test (dotnet test) → build (Docker image, push,
main/stage only) → deploy (SSH, docker compose pull && up -d).