Skip to content

Prometheus Configuration

Prometheus is the monitoring solution open-sourced by SoundCloud, featuring its support for a multidimensional data model, flexible query language, and powerful alarm management. EMQX supports integration with Prometheus as a third-party monitoring system. For more information about this feature, see Integrate with Prometheus.

You can enable and configure the Pushgateway through the base.hocon configuration file, for example:

bash
prometheus {
  push_gateway_server = "http://127.0.0.1:9091"
  interval = 15s
  headers {}
  job_name = "${name}/instance/${name}~${host}"
}

where,

  • push_gateway_server is to set the URL of a Prometheus push gateway server, which is used to push metrics to Prometheus, default: http://127.0.0.1:9091.
  • interval is to set the interval at which metrics will be collected and exported to Prometheus, default: 15s.
  • headers is to set the additional headers to be included in the HTTP request made to the Prometheus push gateway server.
  • job_name is to set the name of the job in Prometheus to which the metrics will be exported, default: "${name}/instance/${name}~${host}"

TIP

You can also use Dashboard to configure the push mode integration with the Prometheus by clicking Management -> Monitoring -> Integration on the left navigation menu.

Once you configured the integration via the Dashboard, your settings will override the same configuration items in config files. If you want to configure Prometheus from config files, it is recommended to use base.hocon instead of emqx.conf. This is because if the configuration is set in emqx.conf, any changes made through the Dashboard will only be temporary and will be lost when EMQX restarts.

TIP

EMQX offers more configuration items to serve customized needs better. For details, see the EMQX Enterprise Configuration Manual for Enterprise.