Design a metrics monitoring system

Quick Overview

Design a metrics monitoring system evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Design a metrics monitoring system

Company: Current

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design a metrics monitoring system. Requirements: collect numeric metrics from many services (counter/gauge/histogram) with labels/tags; support pull vs. push ingestion, high throughput, and backpressure; store time-series efficiently with compression and retention tiers (hot vs. cold storage); provide a query language for aggregations, downsampling, and label filtering; generate alerts on thresholds and SLOs with silencing, deduplication, and routing; ensure high availability, horizontal scalability, and multi-tenant isolation; control cardinality growth and enforce quotas; expose dashboards and APIs; discuss data model, sharding, indexing, write/read paths, failure handling, and consistency choices.

Overview: Design a metrics monitoring system evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Community answers

Answer by siddhantaws

Assumpption Alert boundry Last 20 min Scale 1M request per second 10K servers each server generate 10 metric and there 3 region stpe would be 10 sec Functional requirement Store metric information generated by each server Raise alert once it meet the criteria Generate a dashboard for metric for specific series XOR compression Rollup step would 1 min after 24 hrs tenent isolation Non Functional Availability >consistency . 99.9 available SLO , SLA 99.99 with error rate Alert raise p50 -> 10 sec p99 with in 30 sec Query interval p99 - 600ms Entity metric name such as cpu ,memory,disk,4XX, 5XX series { "metric_name" :"cpu" , "time" : "312313" , "value" : 100, "tags" : {"region ": "us-east" } } - Design consideration pull vs push PUll Easy , handle back pressure , service discovery , tracking ip , seprate service for fetching data Push Each light weight instance need to fetch and call metric with data with queue buffer it has to handle back pressure once got 429 error or ignore Drop message API GRPC message MetricMesage { int id 1 , streing metric_name 2, int64 timestamp 3, int 32 value 4; map tags 5; } message MetricMesageResponse { streing metric_name 1, int status 2, int delay 3, } service SendMetricMessage { rpc SendMessage(MetricMesage ) return MetricMesageResponse } GET /ap1/v1/{tenent_id}/query?metric_name=<>&region=<>&step= cursor based pagination { "nextpageCustor" : } POST api/v1/{tenent_id}/alerts { "name" : "cpu_avg_more50", "notification " : "notification_channel", "c
Current logo
Current
Jul 31, 2025
hardSoftware EngineerTechnical ScreenSystem Design
24
0

Design a metrics monitoring system

System Design: Metrics Monitoring Platform

Context

Design a cloud‑native, multi‑tenant metrics monitoring system for internal services. The system must support counters, gauges, and histograms with labels/tags, ingest via pull and push, provide a query language, alerting, dashboards, and strong operational characteristics (HA, scale, quotas, isolation).

You may assume an illustrative scale (adjust as needed):

  • Aggregate ingest: up to 10M samples/sec across tenants.
  • Retention: 7 days hot, 12 months cold.
  • Query SLO: p99 < 2s for 6h range queries.
  • Availability target: 99.9%.

Requirements

  1. Ingestion
    • Collect numeric metrics (counter/gauge/histogram) with labels/tags.
    • Support pull (scraping endpoints) and push ingestion.
    • Handle high throughput and provide backpressure.
  2. Storage
    • Efficient time‑series storage with compression.
    • Retention tiers: hot vs. cold storage; support downsampling.
  3. Query
    • Provide a query language for aggregations, label filtering, and downsampling.
    • Support federated queries across hot/cold tiers.
  4. Alerting
    • Threshold and SLO‑based alerts; silencing, deduplication, routing.
  5. Operations
    • High availability, horizontal scalability, and multi‑tenant isolation.
    • Control cardinality growth; enforce quotas and rate limits.
    • Expose dashboards and APIs.
  6. Architecture Deep Dives
    • Discuss data model, sharding, indexing.
    • Detail write/read paths, failure handling, and consistency choices.

Deliverables

  • End‑to‑end architecture proposal with components and data flow.
  • Rationale and trade‑offs for key design choices.
  • Guardrails for cardinality, quotas, and backpressure.
  • Failure scenarios and recovery strategies.
  • API surface and operability plan (dashboards, SLOs).

Clarifying Questions to Ask Guidance

  • Clarify users, core use cases, read/write patterns, scale, latency, availability, and data retention.
  • State explicit assumptions before making sizing or architecture decisions.
  • Prioritize the functional path first, then address reliability, security, observability, and rollout.

What a Strong Answer Covers Guidance

  • A scoped requirements summary with concrete non-goals and success metrics.
  • API, data model, architecture, consistency, capacity, and operations.
  • Reasoned trade-offs among simple and scalable designs, including bottlenecks and failure modes.
  • A validation, monitoring, migration, and launch plan appropriate for the risk level.

Follow-up Questions Guidance

  • What breaks first at 10x traffic or data volume?
  • How would you degrade gracefully during dependency failures?
  • What metrics and alerts would prove the design is healthy after launch?