Grafana: Custom timestamp formatting

Sometimes I want to have more control on how Garafana formats timestamps in its panels. This may be dependent on grafana settings and the browser locale, but sometimes I want to make sure timestamps are formatted exactly how I want. This will be a quick write-up of how I’m doing it, so I don’t forget it until I have to do it the next time. As an example, I’m going to use the panel created for the weekly delta Grafana/Prometheus post .

  1. Open the “Edit panel” view of a panel you want to customize
  2. In the side bar, scroll down to field overrides at the very bottom.
  3. Click the “Add field override” button and select “fields with name”. Screenshot showing the “Add field override” button with “fields with name” selected
  4. Choose “Time” in the “Fields with name” field
  5. Click “Add override property” and type unit to choose “Standard options > Unit” from the list
  6. Enter time: followed by a timestring of your choice in the text field, for example time:DD.MM.YY for a german-style date formatting Screenshot of the time formatting as a field override

The resulting panel should show appropriately formatted timestamps on the X-axis:

Resulting Grafana panel with formatted timestamps on the X-axis