metering-operator
metering-operator copied to clipboard
Report schedule local time support
Environment:
- OpenShift v4.2
Description
Metering report is leveraged by us to generate daily, weekly and monthly report, and we found that the report always generated at UTC 0:0:0 time.
It's expected to generate the report at local time(Asia/Shanghai, UTC+8) 0:0:0. For the daily and weekly report, we can leverage the 'hour' setting(set hour: 16
of the day, or last day of week).
For the monthly report, it's hard to know what's the last day of the month, so, the workaround doesn't work.
My question:
is it possible to make the report generated using local time 0:0:0? do we have a way to set the timezone info to the reporting-operator pod/container, or set timezone info to the report definition?
@chancez am i right to ask you for help on such 'report time' related case ? or do you know who can help to provide some guide?
@suridaddy Chance does not work for RHT anymore... @timflannagan1 can you help answer @suridaddy's question? Thanks!
@suridaddy sorry for the slow response, I've been pretty tied up recently - in terms of any localized TZ support, I'm not aware of any. I believe we do all of the UTC timestamp processing as cron expressions under-the-hood. Can you tell me more about why you wouldn't be able to use the hour
workaround for monthly reports like you were using for the weekly ones?
@timflannagan1 sorry, i didn't notice your message, and sorry for late response.
Let me explain more as below, I want to get the monthly report at (my timezone) 0:00 AM.
-
If my time is later than the UTC time(like, UTC-2), it's fine, i can specify
hour: 2
of the first day of the month for monthly report to get the monthly report at 0:00 of my time(UTC-2). -
But, my time is earlier than the UTC time(UTC+8). that means, if i want to get the monthly report (at 0:00, my time), i have to specify
hour: 16
of the last day of the month in the report definition. The last day of one month may be 28, 29, 30, or 31. i don't find a way to specify the last day of month in the report definition, that's why i say i can't usehour
workaround for monthly reports.
Freely let me know if it's not clear, thanks.