Complete PromQL toolkit with generation and validation capabilities
94
94%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Advisory
Suggest reviewing before use
A platform engineering team is building a Grafana dashboard for their API gateway (api-gateway). They want to implement the RED method (Rate, Errors, Duration) across all endpoints. The team's Prometheus scrapes two metric types:
http_requests_total — a counter with labels job, endpoint, and status_codenode_memory_MemAvailable_bytes — a gauge (available memory in bytes) with label instanceAn intern recently submitted dashboard panels that apply the same rate() function to both metrics. The senior engineer suspects this is wrong for the gauge metric and has asked you to generate a correct set of queries for the dashboard.
The team wants three queries:
api-gateway jobProduce the queries in a file called queries.promql. Each query should be on its own line with a comment above it explaining what it measures.
Produce a file queries.promql containing the three queries described above, each preceded by a # comment describing what it measures.