prometheus_config.j2 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. global:
  2. scrape_interval: 15s # By default, scrape targets every 15 seconds.
  3. # Attach these labels to any time series or alerts when communicating with
  4. # external systems (federation, remote storage, Alertmanager).
  5. external_labels:
  6. monitor: 'ffdo'
  7. # A scrape configuration containing exactly one endpoint to scrape:
  8. # Here it's Prometheus itself.
  9. scrape_configs:
  10. - job_name: 'supernodes'
  11. scheme: https
  12. bearer_token: '{{ hostvars[groups['supernodes'][0]]['node_exporter_authorization_token'] }}'
  13. scrape_interval: 5s
  14. static_configs:
  15. - targets:
  16. {% for host in groups['supernodes'] %}
  17. - '{{ host }}'
  18. {% endfor %}
  19. - job_name: 'mapservers'
  20. scheme: https
  21. bearer_token: '{{ hostvars[groups['mapservers'][0]]['node_exporter_authorization_token'] }}'
  22. scrape_interval: 5s
  23. static_configs:
  24. - targets:
  25. {% for host in groups['mapservers'] %}
  26. - '{{ host }}'
  27. {% endfor %}
  28. - job_name: 'imageservers'
  29. scheme: https
  30. bearer_token: '{{ hostvars[groups['imageservers'][0]]['node_exporter_authorization_token'] }}'
  31. scrape_interval: 5s
  32. static_configs:
  33. - targets:
  34. {% for host in groups['imageservers'] %}
  35. - '{{ host }}'
  36. {% endfor %}
  37. - job_name: 'buildservers'
  38. scheme: https
  39. bearer_token: '{{ hostvars[groups['buildservers'][0]]['node_exporter_authorization_token'] }}'
  40. scrape_interval: 5s
  41. static_configs:
  42. - targets:
  43. {% for host in groups['buildservers'] %}
  44. - '{{ host }}'
  45. {% endfor %}
  46. - job_name: 'serviceservers'
  47. scheme: https
  48. bearer_token: '{{ hostvars[groups['serviceservers'][0]]['node_exporter_authorization_token'] }}'
  49. scrape_interval: 5s
  50. static_configs:
  51. - targets:
  52. {% for host in groups['serviceservers'] %}
  53. - '{{ host }}'
  54. {% endfor %}