Inconsistent time range inclusivity behavior in API metric queries

Hi everyone! I’ve been testing the CheckMK API’s Get Metric query across different time ranges and noticed some interesting behavior patterns in how the end timestamp is handled.

When querying metrics, the API seems to switch between exclusive [start,end) and inclusive [start,end] ranges depending on the time period:

For periods up to 3 weeks, it’s exclusive [start,end):

  • 1 week: 336 samples (step=1800s)
  • 2 weeks: 336 samples (step=3600s)
  • 3 weeks: 336 samples (step=5400s)

But for longer periods, it becomes inclusive [start,end]:

  • 4 weeks: 337 samples (step=7200s)
  • 1 month (more than 4 weeks): 373 samples (step=7200s)
  • 1 old month (e.g., Aug 1 to Sep 1): 125 samples (step=21600s)

Is this expected behaviour? I couldn’t find documentation about it.

Looking forward to your insights!
Thank you very much!

what kind of RRD settings do you have?

Are you referring to the RRDCached tuning in Setup → Global Settings?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.