Prometheus Devops Interview Questions Part-3
Q9: Explain PromQL and provide examples of common queries. PromQL (Prometheus Query Language) is Prometheus's powerful functional language for querying time series data. Think of it as SQL for metrics - it helps you extract meaningful insights from your monitoring data. Core Data Types: Instant Vector : Current value of metrics at a specific time Range Vector : Values over a time period Scalar : Simple numeric values Essential Query Examples: Basic Metric Selection: promql # Get all HTTP requests http_requests_total # Filter by specific conditions http_requests_total { method = "GET" , status = "200" } # Use regex for flexible matching http_requests_total { status =~ "2.." } # All 2xx status codes Rate Calculations: promql # Requests per second over 5 minutes rate ( http_requests_total [ 5m ] ) # Total increase over 1 hour increase ( http_requests_total [ 1h ] ) Aggregations: promql # Sum all requests across instances sum...