metricsql icon indicating copy to clipboard operation
metricsql copied to clipboard

Add ability to use business days in metricsql

Open dmitry-shur opened this issue 8 months ago • 3 comments

Currently both PromQL and MetricsQL are missing search abilities based on business days. Please consider an option to calculate dates based on "business days". Business days should be considered Monday - Friday with Monday as 1st day of week.

dmitry-shur avatar Apr 14 '25 09:04 dmitry-shur

@dmitry-shur curious if you could share some real-world use cases? Also, how do you envision the syntax looking like?

makasim avatar Apr 15 '25 06:04 makasim

The real world use cases for adding business days would be things like

  • SLIs that only apply on working days, like network uptime in an office
  • measuring how often a space is occupied during business days from IoT sensors

tiny-pangolin avatar Apr 15 '25 14:04 tiny-pangolin

It would also be helpful if this issue could cover calendar months as well to make things like billing queries simpler

tiny-pangolin avatar Apr 15 '25 19:04 tiny-pangolin

Similar feature request, for calendar month: https://github.com/VictoriaMetrics/VictoriaMetrics/issues/9685

jiekun avatar Sep 10 '25 08:09 jiekun

Following internal discussions we decided not to move forward with implementation

dmitry-shur avatar Nov 06 '25 09:11 dmitry-shur