sentry-prometheus-exporter icon indicating copy to clipboard operation
sentry-prometheus-exporter copied to clipboard

Bug on first day of month

Open tparsa opened this issue 3 years ago • 3 comments

Describe the bug On this line on first day of month today and today.replace has a really close timestamp which leads to 0 events.

I recommend using the following instead first_day_month = datetime.timestamp(datetime.today().replace(day=1, hour=0, minute=0, second=0, microsecond=0)) or

from datetime import date
first_day_month = datetime.timestamp(datetime.combine(date.today(), datetime.min.time()))

tparsa avatar Jan 01 '22 12:01 tparsa

I can open a pull request with one of the above changes if you confirm this is a valid bug. @italux

tparsa avatar Mar 02 '22 18:03 tparsa

I can open a pull request with one of the above changes if you confirm this is a valid bug. @italux

Hey @tparsa thanks for the catch, please go ahead and on a pull request with your proposed fix

italux avatar Mar 22 '22 21:03 italux

I just opened a pr for this (pull #53).

tparsa avatar Apr 27 '22 16:04 tparsa