rate(http_requests_total[5m]) to monitor HTTP requests per second over the last 5 minutes. What type of output do you expect from this query?rate() function does in Prometheus queries.The rate() function calculates the per-second average increase of a counter over the specified time window. Here, it returns a time series showing the average HTTP requests per second over the last 5 minutes.
my-app in the default namespace every 15 seconds. Which scrape configuration snippet correctly achieves this?Option C uses Kubernetes service discovery with role: endpoints and filters targets by the service name my-app. This is the correct way to scrape metrics from a Kubernetes service.
To alert on CPU usage, you write an alerting rule in Prometheus, load it, and configure Alertmanager to send notifications. Other options do not follow the correct alerting workflow.
Prometheus relies on labels or annotations to discover pods for scraping. If missing, Prometheus won't scrape metrics even if the pod is healthy.
Selective scraping using service discovery with relabeling and adjusting scrape intervals reduces load and improves performance. Other options cause unnecessary load or complexity.