sipcapture / homer7-docker

HOMER 7 Docker Images
93 stars 87 forks source link

Grafana dashboards for multiple promethus targets #121

Closed perrfect closed 2 years ago

perrfect commented 2 years ago

Hello.

I have two Heplify-server on different location (e.g EU and US), one Database server and one Prometheus server. All data from two heplify-server write on the same database and one prometheus.

Prometheus configuration:

- job_name: heplify-server-eu
  honor_timestamps: true
  scrape_interval: 5s
  scrape_timeout: 5s
  metrics_path: /metrics
  scheme: http
  follow_redirects: true
  enable_http2: true
  static_configs:
  - targets:
    - test-eu:9096
- job_name: heplify-server-us
  honor_timestamps: true
  scrape_interval: 5s
  scrape_timeout: 5s
  metrics_path: /metrics
  scheme: http
  follow_redirects: true
  enable_http2: true
  static_configs:
  - targets:
    - test-us:9096

Grafana visualizes data from Prometheus correctly, but on dashboards I can't understand which graph belongs each datacenters. Is it possible to sign graphs for each datacenters? And what should be the prometheus configuration?

lmangani commented 2 years ago

Hello @perrfect the simplest solution would be to add a label for each scraped DC/Region:

- job_name: 'heplify-server'
    scrape_interval: 5s
    static_configs:
      - targets: [ 'heplify-server-us:9096' ]
        labels:
          region: 'US'
      - targets: [ 'heplify-server-eu:9096' ]
        labels:
          region: 'EU'
perrfect commented 2 years ago

Hello @lmangani thank you for reply. In this case should I change something in Grafana dashboards in docker?

lmangani commented 2 years ago

@perrfect not really - you're better off creating your own cloned dashboards w/ group-by or filtering by the new region labels

lmangani commented 2 years ago

Closing as non-issue, feel free to comment further if suggestions are needed