InfluxDB Metrics Exporter
The InfluxDB Metrics Exporter collects broker metrics and sends them to the configured InfluxDB. For a detailed overview of all metrics, please refer to the Available Metrics section. This resource provides descriptions and categorizations of each metric, helping to understand how they contribute to monitoring and analyzing system performance.
Connection and authentication
The InfluxDB exporter can operate with InfluxDB servers 2.0
upwards and 1.x
. These are configured differently to one another.
Influx 2.x
To use InfluxDB 2.0 or above, you must configure a host, organization, bucket, and authentication token:
plugin_opt_host https://example.hoster.cloud2.influxdata.com
plugin_opt_organisation my-organisation
plugin_opt_bucket my-bucket
plugin_opt_token <token>
If you are using InfluxDB cloud, these values should all be easily discoverable. The plugin_opt_token option can contain either your literal authentication token, or the special value env. If set to env, the token will be read from the INFLUXDB_TOKEN environment variable instead.
Influx 1.6/8
To use InfluxDB 1.8 or 1.6, you must configure at least a hostname and database:
global_plugin /usr/lib/cedalo_metrics_influxdb.so
plugin_opt_hostname influxdb.example.com
plugin_opt_database my-database
plugin_opt_port 8086
plugin_opt_use_tls true
Basic Authentication
Basic HTTP authentication is supported for both connection modes by specifing a username and password:
...
plugin_opt_username my-username
plugin_opt_password my-password
Configuration
plugin_opt_hostlabel
- use a specific label for this host when sending data. If not specified, the local hostname will be used.
plugin_opt_measurement
- the measurement string to use when sending data. If not specified, mosquitto will be used.
plugin_opt_cafile
- a path to an x509 encoded certificate that should be trusted for making encrypted connections to the server.
plugin_opt_update_interval
- the interval between metrics submissions, in seconds.
A sample configuration could look like:
global_plugin /usr/lib/cedalo_metrics_influxdb.so
plugin_opt_update_interval 60
plugin_opt_hostname influxdb.example.com
plugin_opt_port 8100
plugin_opt_hostlabel broker1
plugin_opt_database edge_data
plugin_opt_use_tls true
plugin_opt_username username
plugin_opt_password password
Optional configuration (applies to both exporters)
You may also consider turning off the $SYS updates from the broker:
sys_interval 0
If activated, these will be counted into the existing metrics.
Plugin Activation
To enable the InfluxDB Metrics Exporter plugin it must be loaded into the broker with, by adding the
following to your mosquitto.conf
:
global_plugin /usr/lib/cedalo_metrics_influxdb.so