Skip to content

Commit

Permalink
feat: Add support for prometheus_remote triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetrergeru committed Sep 21, 2023
1 parent e5925d4 commit 27be393
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions library/moira_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
- Use remote storage.
required: False
default: False
trigger_source:
description:
- Specify trigger source, overrides is_remote
required: False
choices: ['graphite_local', 'graphite_remote', 'prometheus_remote']
desc:
description:
- Trigger description.
Expand Down Expand Up @@ -514,6 +519,10 @@ def main():
'type': 'bool',
'required': False,
'default': False},
'trigger_source': {
'type': 'str',
'required': False,
'choices': ['graphite_local', 'graphite_remote', 'prometheus_remote']},
'desc': {
'type': 'str',
'required': False,
Expand Down Expand Up @@ -571,6 +580,7 @@ def main():
'desc': module.params['desc'],
'tags': module.params['tags'],
'mute_new_metrics': module.params['mute_new_metrics'],
'trigger_source': module.params['trigger_source'],
'sched': get_schedule(
module.params['start_hour'],
module.params['start_minute'],
Expand Down
1 change: 1 addition & 0 deletions tasks/manage_triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ttl: '{{ item.ttl | default(omit) }}' # Time to Live (in seconds) (int)
ttl_state: '{{ item.ttl_state | default(omit) }}' # Trigger state at the expiration of 'ttl' (string)
is_remote: '{{ item.is_remote | default(omit) }}' # Use remote storage (bool)
trigger_source: '{{ item.trigger_source | default(omit) }}' # Specify trigger source, override is_remote (str)
desc: '{{ item.desc | default(omit) }}' # Trigger description (string)
mute_new_metrics: '{{ item.mute_new_metrics | default(omit) }}' # Mute new metrics (bool)
disabled_days: '{{ item.disabled_days | default(omit) }}' # Days for trigger to be in silent mode (list)
Expand Down

0 comments on commit 27be393

Please sign in to comment.