Monitoring Foreman with Prometheus

Hello,

prometheus-client rubygem 1.0 has been finally released, it fixed one of the major pain-points of supporting multiple instances by sharing metric storage surprisingly in a simple file. I’ve been in touch with the developers, if you want more details there is exciting talk available from RubyConf 2019:

I’ve just bumped our RPM dependency we carry in our repos, for Debian there is nothing to wait for:

To start monitoring Foreman via Prometheus simply:

yum -y install foreman-telemetry prometheus-client

And enable it in settings.yaml:

:telemetry:
  :prefix: 'fm_rails'
  :statsd:
    :enabled: false
    :host: '127.0.0.1:8125'
    :protocol: 'statsd'
  :prometheus:
    :enabled: true
  :logger:
    :enabled: false
    :level: 'INFO'

Then make Prometheus to scrape /metrics endpoint. The client library will now work under Passenger or any other forking server giving the correct numbers.

2 Likes

The client library RPM update will be part of the 1.24.1 minor update. Follow this guide to enable Prometheus and scrape telemetry data from Foreman application from version 1.24.1! Thanks @tbrisker for the extra effort.

Thanks!
I’m testing this on Satellite 6(.7 snap) and it seems to work great. Anyway, is there any plan to extend this with katello-related metrics?
I think scraping some katello instance counts via fm_rails_activerecord_instances might be really helpful in regards to performance monitoring.

Great job!

Telemetry does work with all the plugins, including Katello ones. For example I see “class=Katello::Subscription” labeled metric and others.

1 Like

Here is an example dashboard for Grafana via Prometheus official Data Source:

https://lzap.fedorapeople.org/projects/foreman-monitoring/Foreman-1.24-1578398134479.json.gz

@rplevka I no longer have the setup, can you make some screenshots and post it here if it works for you?