Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ping-Tower / Metrics Writer

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).

Stack

C# / .NET Worker Service (net10.0), layered Domain → Application → Infrastructure, RabbitMQ.Client, ClickHouse.Client, Dapper, Polly

Role in the system

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_SIZE records or RABBITMQ_FLUSH_INTERVAL_MS elapsed — then bulk-inserts into the server_pings table in ClickHouse.
  • RABBITMQ_PREFETCH_COUNT / RABBITMQ_CHANNEL_CAPACITY bound how far the consumer can run ahead of the writer to avoid unbounded memory growth.

Running locally

cp .env.example .env
docker compose up --build

Key environment variables (.env.example): RABBITMQ_* (broker connection, queue, batch size, flush interval, prefetch/channel capacity), CLICKHOUSE_CONNECTION_STRING.

CI/CD (GitLab)

.gitlab-ci.yml: test (dotnet test) → build (Docker image, push, main/stage only) → deploy (SSH, docker compose pull && up -d).

About

Time-series ingestion worker for PingTower - batches ping results from RabbitMQ into ClickHouse.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages