Skip to main content
This lesson explains how to query historic metric values with PromQL modifiers. So far we’ve been returning the most recent value for a metric. PromQL provides two modifiers — 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 the offset modifier to retrieve a metric value from some time ago. The modifier accepts a time duration (for example, 5m for five minutes):
The image is a table showing time unit suffixes with their meanings, including milliseconds, seconds, minutes, hours, days, weeks, and years.
Supported time suffixes: 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:
The image is a slide titled "Offset Modifier," explaining how to use the "@" modifier to navigate to a specific point in time, with a green label highlighting "@ modifier."
Note: Unix timestamps used with @ 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:
Both queries return the metric value five minutes before the specified timestamp (for example, if the timestamp corresponds to 06:06, the returned value is from 06:01).
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:
These modifiers let you precisely inspect historical values and sample windows — useful for incident postmortems, trend analysis, and retroactive debugging.

Additional resources

Watch Video