promslog: Use the default timezone (again) by beorn7 · Pull Request #739 · prometheus/common (original) (raw)
This reverts commit 145b50a.
See discussion on Slack. We should first decide which log format we want before changing it from what is already released in prometheus/prometheus.
UPDATE:
This is the new commit description:
As per the dev-summit discussion, we want to use the default timezone
as selected by slog after all rather than a hardcoded UTC.
(This was accidentally introduced earlier when moving from gokit to
slog, but then switched back to hardcoded UTC in PR #735.)
Environments that have configured UTC anyway won't see any difference,
but those with other timezones configured will see the configured
timezone for the timestamps in their logs. This is in line with how
slog behaves by default.
Example timestamp before this change and also after this change
with UTC configured in the environment via a suitable way (e.g.
setting TZ=UTC
on Linux):
time=2025-04-10T12:00:38.179Z
Example timestamp after this change with location Europe/Berlin,
i.e. timezone is CET or CEST:
time=2025-04-10T14:00:03.120+02:00
Note that the precise delta to UTC is in the timestamp. So this change
will also be transparent to the usual logs processing tools.