Recording rules with OFFSET

137 views
Skip to first unread message

Ilin

unread,
Jun 8, 2019, 9:00:26 AM6/8/19
to Prometheus Users
Hi,

What are the best practices for rules with OFFSET? 

Example:

---
groups:
  - name: example
    rules:
    - record: job:http_inprogress_requests:sum
      expr: sum(http_inprogress_requests) by (job)
    - record: job:http_inprogress_requests:sum
      expr: sum(http_inprogress_requests offset 1d) by (job)
      labels:
        offset: 1d
    - record: job:http_inprogress_requests:sum
      expr: sum(http_inprogress_requests offset 2d) by (job)
      labels:
        offset: 2d

Matt Pursley

unread,
Jun 20, 2019, 1:24:11 PM6/20/19
to Ilin, Prometheus Users
Here's a good write up for using offsets to find issues (spikes/drops) in very "seasonal" data...

Anyone else here have notes or tips with working with time offsets or seasonal data like this (e.g. user or network traffic, with large daily, weekly or monthly cycles)?




--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/8839af57-f719-4b4d-8826-57cc4e06d438%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages