- name: install zuul check
  copy:
    src: zuul_server.py
    dest: "{{ datadog_file_dir }}/zuul_server.py"
  notify: restart dd-agent
- name: monitor zuul merger count
  datadog_monitor:
    api_key: "{{ secrets.datadog.api_key }}"
    app_key: "{{ secrets.datadog.ansible_app_key }}"
    name: zuul merger count
    state: present
    type: "metric alert"
    message: "no zuul mergers"
    query: 'min(last_5m):avg:gearman.workers_by_task{host:zuul,task:merger:merge} < 1'
  vars:
    ansible_python_interpreter: /opt/datadog/bin/python

- name: install zuul check
  copy:
    src: zuul_server.py
    dest: "{{ datadog_file_dir }}/zuul_server.py"
  notify: restart dd-agent
- name: monitor zuul merger count
  datadog_monitor:
    api_key: "{{ secrets.datadog.api_key }}"
    app_key: "{{ secrets.datadog.ansible_app_key }}"
    name: zuul merger count
    state: present
    type: "metric alert"
    message: "no zuul mergers"
    query: 'min(last_5m):avg:gearman.workers_by_task{host:zuul,task:merger:merge} < 1'
  vars:
    ansible_python_interpreter: /opt/datadog/bin/python
  tags: ddapi

Add ddapi tag to tasks that call the API
Add ddapi tag to tasks that call the API

These are tasks we may want to skip when testing outside of production,
where we might not have a datadog API key. Better to skip just these
tasks than all of monitoring.
