Wandering Thoughts archives

2020-12-02

Prometheus 2.23.0 now lets you display graphs in local time

Over in the Fediverse, I said:

A quietly great thing about Prometheus 2.23.0 is that it's finally easy and natural to display graphs for quick ad-hoc queries in local time instead of UTC.

(No, we don't run our servers or do our work in UTC. There are many reasons for this, including that our users don't work in UTC or around the clock.)

All of our serious, full time graphs and other information are in Grafana dashboards, which normally show all of their times in local time (I believe the local time of your browsers, but perhaps it's the server local time; in my case they're the one and the same). However, for poking around and exploring things on an ad hoc basis I generally find Prometheus's own query and graph options to be better than Grafana's Explore feature, and I default to using it.

Prometheus has always been very firm that it works in UTC, not in whatever local time. As part of this, its ad hoc query and graph display always showed UTC time. Since we run our servers in our local time zone, not UTCS, this made it rather annoying to correlate between problem reports and logs (in local time) and the Prometheus ad-hoc graphs (in UTC). This sometimes pulled me back to Grafana's Explore, despite liking it less and finding it more work to deal with.

The 2.23.0 release notes don't come out to say that you can now get Prometheus's ad-hoc graphs and queries to display in your local time zone. Instead they just have, as one of their changes:

  • [CHANGE] UI: Make the React UI default. #8142

However, I had already tried out the React version of the UI when it started to show up as an experimental feature in earlier versions of Prometheus, so I knew that one of the options it had was a little tick box for 'Use local time', a tick box (and option) that was not present in the old UI.

(Of course I could always switch to the React UI in previous versions of Prometheus, but it was labeled as experimental and potentially incomplete, and it was always a little bit of extra work to use it. I did turn to it if I really needed a graph in local time, but usually I lived with the friction of having things in UTC.)

PrometheusNewLocalTime written at 23:40:45; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.