9

I am using CloudWatch and I find that timezones appear in either UTC or the local timezone variously in different contexts. For example, when I look at one right now, in CloudWatch > Logs I see Log Streams shown in local time. In Metrics, they appear in UTC.

This can make troubleshooting difficult.

How can I ensure that a single timezone appears in all contexts, all throughout CloudWatch?

Alex Harvey
  • 14,494
  • 5
  • 61
  • 97

2 Answers2

15

This answer follows the layout of the CloudWatch console (at the time of writing).

The procedure should fix the time zone in all contexts other than Event Rule Schedule Expressions, where Amazon's documentation states that only UTC is possible.

PROCEDURE

Go to CloudWatch console at https://console.aws.amazon.com/cloudwatch/

Metrics

In the nagivation pane, choose Metrics.

Choose the custom menu and then choose UTC or Local timezone.

This will take effect in all contexts where metrics are displayed, e.g. in Dashboards, Lambda functions etc.

Logs

In the navigation pane, choose Logs.

For Log Groups, choose any log group to view some streams.

For Log Streams, choose any log stream name to view some log data.

Now to change the timezone, click on the blue date/time in the top-right corner. Choose UTC or Local timezone and then click Cancel.

Alarms history

Under Alarms, there are alarms, and on selecting an alarm, there is a History tab. These take their timezone from the Metrics above. There should be nothing to do in here.

Events

Under Events there are Schedule expressions for Rules. Unfortunately, as noted above, Amazon's documentation states that all scheduled events use UTC time zone.

References

Modify the Time Range or Time Zone Format for a Graph

Working With Log Groups and Log Streams

Schedule Expressions for Rules

Alex Harvey
  • 14,494
  • 5
  • 61
  • 97
  • Where should I set the local timezone? – SenG May 23 '20 at 05:44
  • Your local timezone should be coming from your browser i think. "Local time is the time zone that's specified in your computer's operating system. " - ref https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/change_dashboard_time_format.html – Nestor Milyaev Jun 07 '23 at 14:04
6

Lambda function - 'Monitoring' ['CloudWatch metrics at a glance']

(apparently not controlled in CloudWatch console)

'custom' menu/dropdown > 'Local timezone':

enter image description here

cellepo
  • 4,001
  • 2
  • 38
  • 57
  • I seem to recall that the instructions I documented below did fix the timezone in this Lambda context. Just checking, did you firstly follow all the below instructions? – Alex Harvey Nov 04 '18 at 22:39
  • I only followed directions you gave for Metrics, since the CloudWatch metrics in Lambdas is all I am presently focused on. I don't see how the other sections would relate (i.e: there are no logs in those CloudWatch metrics). Your Answer is a good main reference. – cellepo Nov 05 '18 at 01:55
  • 1
    Thank you for the screenshot. Sooo much clearer than explaining in text <3 – mraxus Apr 20 '22 at 09:39