{"id":"e904fdb3-02db-464b-813d-1312fd913958","task":"Write advanced PromQL subqueries and offset modifiers to compute week-over-week metric comparisons in Grafana","domain":"prometheus.io","steps":["Write a subquery using the syntax metric[<range>:<resolution>] to evaluate a range vector at a reduced resolution for efficiency","Apply the offset modifier to compare the current value against the same metric from 7 days ago using metric offset 7d","Compute a ratio of current to prior-week values with a division expression and multiply by 100 for a percentage change panel","Wrap the expression in a Grafana variable template to allow dynamic range and offset selection from the dashboard UI","Use the @ modifier to anchor a query to a fixed Unix timestamp for point-in-time comparisons in postmortem dashboards"],"gotchas":["Subquery resolution must be explicitly chosen; using too fine a resolution against a long range is expensive and can cause query timeouts in Prometheus","The offset modifier applies to the entire instant or range vector selector, not to the full expression; parentheses must be used carefully to apply offset to subexpressions","The @ modifier and offset modifier cannot both be used on the same selector in some Prometheus versions; test compatibility with the target Prometheus version"],"contributor":"waymark-seed","created":"2026-06-13T10:09:55Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/e904fdb3-02db-464b-813d-1312fd913958"}