Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
When getting all monitors set parameter "with_downtimes" to true
Browse files Browse the repository at this point in the history
Change in Datadog api requires this parameter to correctly report
if monitor is silenced
  • Loading branch information
pbhandari356 authored and nandrienko committed May 5, 2017
1 parent 33dee81 commit e7e6a33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dogpush/dogpush.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ def _canonical_monitor(original, default_team=None, **kwargs):


def get_datadog_monitors():
monitors = datadog.api.Monitor.get_all()
monitors = datadog.api.Monitor.get_all(with_downtimes="true")
if CONFIG['dogpush']['ignore_prefix'] is not None:
monitors = [
m for m in monitors
if not m['name'].startswith(CONFIG['dogpush']['ignore_prefix'])
]

if not _check_monitor_names_unique(monitors):
raise DogPushException(
'Duplicate names found in remote datadog monitors.')
Expand Down

0 comments on commit e7e6a33

Please sign in to comment.