Metrics System Design | System Design Interview | Skill-Lync Resources
Hard System Design Microservices

How would you design a metrics collection and monitoring system?

Answer

Pipeline: agents collect (StatsD, Prometheus scrapers) -> message queue (Kafka) -> stream processing (aggregation) -> time-series DB (InfluxDB, TimescaleDB) -> visualization (Grafana). Metrics types: counters, gauges, histograms. Aggregation: pre-aggregate at collection, rollups for longer retention. Query: downsampling for large ranges, caching. Alerting: rules engine, notification routing (PagerDuty). Scale: shard by metric name or tag combination, compression (gorilla encoding). Retention: high-resolution recent, rollups for historical. Cardinality: limit unique tag combinations. Distributed tracing integration: correlate metrics with traces.

Master These Concepts with IIT Certification
IIT Certified

Master These Concepts with IIT Certification

175+ hours of industry projects. Get placed at Bosch, Tata Motors, L&T and 500+ companies.

Relevant for Roles

SRE Platform Engineer DevOps Engineer