Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mute_time_intervals in local time zone #2771

Closed
arnitolog opened this issue Nov 22, 2021 · 7 comments
Closed

mute_time_intervals in local time zone #2771

arnitolog opened this issue Nov 22, 2021 · 7 comments

Comments

@arnitolog
Copy link

Hello,

Does it make sense to add an ability to specify mute_time_intervals start and end times in the local time zone instead of UTC?
Let's imaging that we deploy the same service in 4 regions (US, EU, APAC, AE), And we have a maintenance job for this service starting at 1:00 AM local time.
Also, we have a local Prometheus/Alertmanager in every region.
With the current approach, we have to have 4 different configurations of Alertmanager depending on the target region because the start time will be different in UTC. Also, onboarding a new region will also require Alertmanager's config modification.
Having the configuration in local time will allow having the same config across all regions, and do not care about time conversion

@xkilian
Copy link

xkilian commented Nov 30, 2021

Same here, we are in a time zone that changes year by year for daylight saving.

Only having UTC makes it much more annoying to maintain offhour schedules.

There must be a go library that handles timezones?! Is there interest from the devs for a pull request to implement this?

@benridley
Copy link
Contributor

benridley commented Dec 3, 2021

Hi @arnitolog,

Yes there is interest in this, and it was discussed when the feature was first merged. Initially the mute time interval specification allowed a timezone parameter as part of the definition, however this had some issues. The main problem is that Go does not use the Windows time zone database, so conversion between time zones simply does not work on Windows which is a platform that Prometheus/Alertmanager supports, so we couldn't do it without breaking support for that platform.

That being said, Go is capable of retrieving the servers local time from Windows, just not arbitrarily converting between time zones on Windows. Perhaps the easiest option here is to just allow using the servers local timezone as a boolean flag in the timezone definition rather than allowing arbitrary time zones as a parameter.

I'm happy to add this if @simonpasquier or @w0rm are ok with the concept.

@roidelapluie
Copy link
Member

We could load the default timezone go provides if we also provide the user the ability to load a fresher timezone file.

@benridley
Copy link
Contributor

I've just opened #2782 which allows a user-specified timezone in time interval definitions. For Windows, users can pass in 'Local' which works without a timezone database and (I would guess) addresses most users who just want to use a local time.

@ohadasulin
Copy link

ohadasulin commented Apr 11, 2022

Anything specific that prevents #2782 from being merged?
It's a great feature to have for global companies, we eagerly wait for this to be merged :)

@megamorf
Copy link

I'm also interested in seeing this merged because I'd also like to define time zone specific times.

@splitt3r
Copy link

This is now merged and released via https://github.com/prometheus/alertmanager/releases/tag/v0.25.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants