A prometheus exporter for rsyslog. It accepts rsyslog impstats metrics in JSON format over stdin via the rsyslog omprog plugin and transforms and exposes them for consumption by Prometheus.
Configure rsyslog to push JSON formatted stats via omprog:
module(load="omprog") module( load="impstats" interval="10" format="json" resetCounters="off" ruleset="process_stats" ) ruleset(name="process_stats") { action( type="omprog" name="to_exporter" binary="/usr/local/bin/rsyslog_exporter [--tls.server-crt=/path/to/tls.crt --tls.server-key=/path/to/tls.key]" ) }
The exporter itself logs back via syslog, this cannot be configured at the moment.
web.listen-address
- default :9104
- port to listen to (NOTE: the leading :
is required for http.ListenAndServe
)web.telemetry-path
- default /metrics
- path from which to serve Prometheus metricstls.server-crt
- default ""
- PEM encoded file containing the server certificate and the CA certificate for use with http.ListenAndServeTLS
tls.server-key
- default ""
- PEM encoded file containing the unencrypted server key for use with tls.server-crt
If you want the exporter to listen for TLS (https
) you must specify both tls.server-crt
and tls.server-key
.
The following metrics provided by the rsyslog impstats module are tracked by rsyslog_exporter:
Action objects describe what is to be done with a message, and are implemented via output modules. For each action object, the following metrics are provided:
Input objects describe message input sources. For each input object, the following metrics are provided:
Queues in rsyslog are used for the main message queue and for actions. Additionally, each ruleset in an rsyslog configuration may optionally have its own separate main queue. For each queue, the following metrics are provided:
Rsyslog tracks how it uses system resources and provides the following metrics:
The omfile module can generate file names from a template. A cache of recent filehandles can be maintained, whose sizing can impact performance considerably. The module provides the following metrics:
Rsyslog allows the user to define their own stats namespaces and increment counters within these buckets using Rainerscript function calls.
These are exported as counters with the metric name identifying the bucket, and a label value matching the name of the counter (the label name will always be "counter"). As well as custom metrics, a "global" dynstats namespace is also published with some additional bookeeping counters.
See the dyn_stats documentation for more information.
The imudp module can be configured to run on multiple worker threads and the following metrics are returned: