Prometheus & Grafana (optional)

ArangoSync provides metrics in a format supported by Prometheus. We also provide a standard set of dashboards for viewing those metrics in Grafana.

If you want to use these tools, please refer to their websites for instructions on how to deploy them.

After deployment, you must configure Prometheus using a configuration file that instructs it about which targets to scrape. For ArangoSync you should configure scrape targets for all sync masters and all sync workers. To do so, you can use a configuration such as this:

  1. global:
  2. scrape_interval: 10s # scrape targets every 10 seconds.
  3. scrape_configs:
  4. # Scrap sync masters
  5. - job_name: 'sync_master'
  6. scheme: 'https'
  7. bearer_token: "${MONITORINGTOKEN}"
  8. tls_config:
  9. insecure_skip_verify: true
  10. static_configs:
  11. - targets:
  12. - "${IPMASTERA1}:8629"
  13. - "${IPMASTERA2}:8629"
  14. - "${IPMASTERB1}:8629"
  15. - "${IPMASTERB2}:8629"
  16. labels:
  17. type: "master"
  18. relabel_configs:
  19. - source_labels: [__address__]
  20. regex: ${IPMASTERA1}\:8629|${IPMASTERA2}\:8629
  21. target_label: dc
  22. replacement: A
  23. - source_labels: [__address__]
  24. regex: ${IPMASTERB1}\:8629|${IPMASTERB2}\:8629
  25. target_label: dc
  26. replacement: B
  27. - source_labels: [__address__]
  28. regex: ${IPMASTERA1}\:8629|${IPMASTERB1}\:8629
  29. target_label: instance
  30. replacement: 1
  31. - source_labels: [__address__]
  32. regex: ${IPMASTERA2}\:8629|${IPMASTERB2}\:8629
  33. target_label: instance
  34. replacement: 2
  35. # Scrap sync workers
  36. - job_name: 'sync_worker'
  37. scheme: 'https'
  38. bearer_token: "${MONITORINGTOKEN}"
  39. tls_config:
  40. insecure_skip_verify: true
  41. static_configs:
  42. - targets:
  43. - "${IPWORKERA1}:8729"
  44. - "${IPWORKERA2}:8729"
  45. - "${IPWORKERB1}:8729"
  46. - "${IPWORKERB2}:8729"
  47. labels:
  48. type: "worker"
  49. relabel_configs:
  50. - source_labels: [__address__]
  51. regex: ${IPWORKERA1}\:8729|${IPWORKERA2}\:8729
  52. target_label: dc
  53. replacement: A
  54. - source_labels: [__address__]
  55. regex: ${IPWORKERB1}\:8729|${IPWORKERB2}\:8729
  56. target_label: dc
  57. replacement: B
  58. - source_labels: [__address__]
  59. regex: ${IPWORKERA1}\:8729|${IPWORKERB1}\:8729
  60. target_label: instance
  61. replacement: 1
  62. - source_labels: [__address__]
  63. regex: ${IPWORKERA2}\:8729|${IPWORKERB2}\:8729
  64. target_label: instance
  65. replacement: 2

Note: The above example assumes 2 datacenters, with 2 sync masters & 2 sync workers per datacenter. You have to replace all ${...} variables in the above configuration with applicable values from your environment.

Prometheus can be a memory & CPU intensive process. It is recommended to keep them on other machines than used to run the ArangoDB cluster or ArangoSync components.

Consider these machines to be easily replaceable, unless you configure alerting on prometheus, in which case it is recommended to keep a close eye on them, such that you do not lose any alerts due to failures of Prometheus.