Comments (7)
Hi! 👋 Your timezone in /etc/localtime
is plain text, but as far as I understand it needs to be a symlink to a timezone file in /usr/share/zoneinfo
:
The /etc/localtime file configures the system-wide timezone of the local system that is used by applications for presentation to the user. It should be an absolute or relative symbolic link pointing to /usr/share/zoneinfo/, followed by a timezone identifier such as "Europe/Berlin" or "Etc/UTC". The resulting link should lead to the corresponding binary tzfile(5) timezone data for the configured timezone.
https://www.freedesktop.org/software/systemd/man/latest/localtime.html
Can you try this and see if it works?
from alertmanager.
My current approach works for the other 36+ containers I run. It works for Promtail. It doesn't work for Alertmanager, Loki, Prometheus, or Node-Exporter.
I did check the state of the files in the container:
~$ docker exec alertmanager cat /etc/timezone
America/Edmonton
$ docker exec alertmanager cat /etc/localtime
TZif2[binary-data]LMTMDTMSTMWTMPT
MST7MDT,M3.2.0,M11.1.0
$ docker exec alertmanager date
Wed Apr 17 14:56:40 UTC 2024
from alertmanager.
D'oh! I misread the original comment. Your When I do this though, the date is correct. For example:/etc/localtime
does look correct.
/alertmanager # date
Wed Apr 17 15:01:14 UTC 2024
/alertmanager # ln -sf /usr/share/zoneinfo/America/Edmonton /etc/localtime
/alertmanager # date
Wed Apr 17 09:01:48 MDT 2024
from alertmanager.
Here's my result:
$ docker exec -it alertmanager sh
/alertmanager $ date
Wed Apr 17 15:12:26 UTC 2024
/alertmanager $ exit
$ date
Wed 17 Apr 2024 09:12:28 AM MDT
Are you running alertmanager inside a docker image? Can you share your sanitised compose file details?
Addendum: To make sure both the host and the container output the date in the same format, I used the following:
$ docker exec -it alertmanager sh
/alertmanager $ date -R
Wed, 17 Apr 2024 15:14:26 +0000
/alertmanager $ exit
$ date --rfc-email
Wed, 17 Apr 2024 09:14:30 -0600
from alertmanager.
OK! I think I know what the issue is – I suspect the base image which the docker images for Prometheus and Alertmanager are built on do not have tzdata
installed. This means the TZ
environment variable doesn't work. Can you create an issue in https://github.com/prometheus/busybox?
from alertmanager.
Hi! 👋 I opened an issue for this but I suspect it will be rejected. Please see the following in the FAQ https://prometheus.io/docs/introduction/faq/#can-i-change-the-timezone-why-is-everything-in-utc.
from alertmanager.
Reading the issues, alermanger and prometheus works only in UTC exklusive.
In our company, we are using Grafana to manage the Alertmanager alerts and Grafana will covert the UTC times into local time. Create and silence with local time in grafana will be forwarded in UTC at AM.
from alertmanager.
Related Issues (20)
- Go stdlib vuln - please upgrade go version HOT 4
- AlertManager not respecting repeat_interval timer setting on duplicate alert HOT 1
- `amtool` ZSH completion is broken
- Prometheus Alertmanager not sending email notifications HOT 3
- Alerts are not triggering to its target communications HOT 2
- [UI] Feature: Localtime / Timezone option
- multiple peers send alert that should only be sent once after failed notify attempt HOT 4
- Alertmanager send resolved notification when problem not solved HOT 3
- Cannot send alerts to multiple receivers simultaneously using matchers field. HOT 8
- Unable to change time zone in Grafana Alerting Notification Template (Always in UTC) HOT 1
- bad response status 404 Not Found HOT 1
- Task: Improvements to silences
- Work around PrometheusOperatorSyncFailed, integration=opsgenie, max_runes=130? HOT 1
- config.SecretURL type returns Json.Unmarshal() error which can expose the secret url. HOT 1
- amtool does not have a way to specify a time to test with. HOT 2
- Support time_interval testing with amtool config routes test HOT 2
- AlertManager doesn't send alert to Slack HOT 1
- Docker image prom/alertmanager:v0.27.0 fails to parse webhook_url_file from msteams_config HOT 2
- An option to disable the default sorting of Alerts for a group of Alerts HOT 5
- AlertManager doesn't send some of alerts to Pagerduty
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alertmanager.