offset and @ — to look back in time or anchor queries to a specific timestamp. Use these when you need to inspect values from minutes, hours, or days in the past, or when debugging incidents that happened at a particular time.
offset — shift relative to “now” or an anchored time
Use theoffset modifier to retrieve a metric value from some time ago. The modifier accepts a time duration (for example, 5m for five minutes):

Examples:
@ — anchor to an exact timestamp
To evaluate a metric at an exact point in time, use the@ modifier with a Unix timestamp (seconds since the epoch). This returns the sample closest to that timestamp:

@ are in seconds. Many tools can convert a human-readable time into the Unix epoch if needed.
Combining @ and offset
You can combine@ and offset. When both are present, the @ timestamp serves as the anchor point and offset shifts relative to that anchor. The order of @ and offset does not matter — both forms are equivalent:
You can use
offset and @ with instantaneous vectors (single-value queries) or with range vectors (time windows). The @ timestamp anchors the evaluation, and offset shifts that anchored timestamp or window.Range vectors with anchors and offsets
Range vectors use square brackets to request a window of samples, for example[2m]. By default, [2m] refers to the most recent two minutes. When combined with @ and/or offset, the range vector is anchored and shifted accordingly:
Additional resources
- Prometheus PromQL documentation: https://prometheus.io/docs/prometheus/latest/querying/basics/
- PromQL examples and timestamp usage: https://prometheus.io/docs/prometheus/latest/querying/expression/