Master the Prometheus Query Language from selectors and matchers to advanced aggregations. Learn the difference between instant and range vectors, use rate() and histogram_quantile(), and build production-ready dashboard queries. Starting state: ~/observability-lab/ running with Prometheus, Grafana, OTel Collector, and demo app from Module 1. After this lesson: you can write PromQL queries for any metric in your stack.
Before diving into PromQL, make sure your observability lab and demo app from Module 1 are running. If you stopped them since Lesson 104, restart everything now.
cd ~/observability-lab && docker compose up -decho 'Waiting for services to start...'sleep 5echo 'Checking Prometheus...'curl -s -o /dev/null -w '%{http_code}' http://localhost:9090/-/healthyecho ''echo 'Checking demo app...'curl -s -o /dev/null -w '%{http_code}' http://localhost:4000/echo ''echo 'Generating some traffic for PromQL practice...'for i in $(seq 1 20); do curl -s http://localhost:4000/ > /dev/null; curl -s http://localhost:4000/users > /dev/null; doneecho 'Done! Lab is ready for PromQL practice.'PromQL queries need data to work with. By restarting the lab and sending some requests to the demo app, you ensure Prometheus has fresh metrics to query. The demo app emits metrics through the OTel Collector, and Prometheus scrapes them every 15 seconds.
Both health checks return '200'. The traffic generation completes without errors.