prometheus.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #
  2. # /etc/prometheus/prometheus.yaml (Salt managed)
  3. #
  4. global:
  5. scrape_interval: 30s
  6. evaluation_interval: 1m
  7. # scrape_timeout is set to the global default (10s).
  8. external_labels:
  9. monitor: '{{ grains['id'] }}'
  10. #alerting:
  11. # alertmanagers:
  12. # - static_configs:
  13. # - targets: ['localhost:9093']
  14. #
  15. ## Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
  16. #rule_files:
  17. # # - "first_rules.yml"
  18. # # - "second_rules.yml"
  19. scrape_configs:
  20. - job_name: 'prometheus'
  21. scrape_interval: 5s
  22. scrape_timeout: 5s
  23. static_configs:
  24. - targets: ['localhost:9090']
  25. - job_name: node
  26. static_configs:
  27. - targets:
  28. {%- for node, node_config in salt['pillar.get']('nodes').items()|sort %}
  29. - {{ node }}:9100
  30. {%- endfor %}
  31. - job_name: bind
  32. static_configs:
  33. - targets:
  34. {%- for node, node_config in salt['pillar.get']('nodes').items()|sort %}
  35. {%- if salt['ffho.any_item_in_list'](['dns-auth', 'dns-recursor'], node_config.get('roles', [])) %}
  36. - {{ node }}:9119
  37. {%- endif %}
  38. {%- endfor %}