Tools / Monitoring and Observability Interview Questions
What is Prometheus and how does its pull-based scraping model work?
Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud and now a CNCF graduated project. It stores all data as time-series: streams of timestamped float64 values identified by a metric name and a set of key-value labels.
What makes Prometheus distinctive is its pull-based scraping model. Instead of applications pushing metrics to a central server, Prometheus periodically sends HTTP GET requests to a /metrics endpoint on each target. The response is in Prometheus exposition format — a plain-text, line-by-line format listing metric names, label sets, and values. Prometheus stores the scraped data in its local TSDB (time-series database).
Targets are discovered through service discovery mechanisms: static configuration, Kubernetes API, Consul, EC2 tags, and many others. This means Prometheus automatically starts scraping new pods as they come up and stops when they go down — no manual registration required.
The pull model has important operational implications: Prometheus controls the scrape rate, failed targets are immediately visible as scrape failures, and there is no need for agents to know the Prometheus address. The trade-off is that short-lived jobs (batch jobs) may finish before the scrape happens — solved by the Pushgateway, which acts as an intermediary for ephemeral workloads to push metrics to.
PromQL (Prometheus Query Language) is used to query and aggregate these time-series, feeding both Grafana dashboards and Alertmanager rules.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
