j6s / mailcow-exporter

MIT License
58 stars 12 forks source link

Multi instance monitoring #5

Closed ghost closed 2 years ago

ghost commented 3 years ago

Hello :)

Any chance to get multi instances monitored?

j6s commented 3 years ago

I am a bit unsure what you mean - monitoring multiple mailcow instances with the same instance of mailcow-exporter should be possible by adding multiple targets for it in the prometheus configuration:

scrape_configs:
  - job_name: 'mailcow-server-1'
    static_configs:
      - targets: [ 'mailcow_exporter:9099' ]
    params:
      host: [ 'mailcow-server-1.com' ]
      apiKey: [ 'YOUR-APIKEY-HERE' ]

  - job_name: 'mailcow-server-2'
    static_configs:
      - targets: [ 'mailcow_exporter:9099' ]
    params:
      host: [ 'mailcow-server-2.com' ]
      apiKey: [ 'YOUR-APIKEY-HERE' ]

I suspect however, that multi-instances refers to something else, that I am not familiar with. Could you provide a bit of additional information so I can read up on it?

ghost commented 3 years ago

That would work, but it would mix the result of your grafana dashboard. For example rspamd scanning, rspamd action... I think that only the dashboard needs to be tweaked a bit. Similar to the dashboard of the node exporter. host

I'm not a developer, but if I can figure it out, I'll let you know.

j6s commented 2 years ago

With multiple scrape configs you should be able to differentiate metrics by their job label, which should be the same as job_name in the prometheus config