Datadog monitors use UTC time, which by default does not track local time zones. Depending on the type of system you have, your data could be impacted by local activity happening in your time zone. For example, a lunch surge could cause a spike in the middle of the day, and this surge could be detected as an unexpected anomaly. If you are getting unexpected anomalies caused by local activity, update your anomaly detection monitor to account for your local timezone.
If you are using the agile or robust anomaly detection algorithms with weekly or daily seasonality, you can update your anomaly detection monitor to account for a local timezone using both the API and the UI.
Here is an example of a monitor before it is set to account for a local timezone:
Here is an example of a monitor when daylight savings time is being taken into account:
To update an anomaly detection monitor to account for a local timezone in the UI, navigate to the Create a new monitor > Anomaly monitor section in the UI. In section 3, Set Alert Conditions, open the Advanced panel and toggle on the switch to take daylight savings into account while evaluating the monitor. Then, set the timezone dropdown to match the timezone you want tracked.
America/New_York
or Europe/Paris
. Locate your preferred time zone in the TZ column on the List of tz database time zones (canonical format recommended).timezone
argument to the anomalies() function call.For example, if you wanted to change the query shown above to use New York’s local time, the query would be updated to:
avg(last_4h):anomalies(avg:system.cpu.user{role:trace-cassandra} by {host}, 'basic', 2, direction='both', alert_window='last_15m', interval=60, count_default_zero='true', timezone='America/New_York') >= 1