Rsyslog project evolved significantly in last few years. See the changes related:
- imhttp: expose stats via Prometheus endpoint (released in v8.2510)
- sidecar: add Prometheus impstats exporter sidecar (released in v8.2602)
- impstats: add VictoriaMetrics push support via Prometheus Remote Write (released in v8.2602)
Please use native rsyslog options now!
Thank you for using this project!
This software is acting like a proxy. It reads rsyslog stats on stdin, convert them to the prometheus mertics and expose them via HTTP. Rsyslog stats are expected in 'json' format.
$ sudo install -m 0755 -o root -g root -D -v rsyslog_exporter.py /usr/local/bin/
'rsyslog_exporter.py' -> '/usr/local/bin/rsyslog_exporter.py'
module(load="omprog")
module(load="impstats"
interval="60"
resetCounters="off"
format="json"
ruleset="stats"
)
template(name="stats_exporter_tmpl" type="string" string="%msg%\n")
ruleset(name="stats"
) {
action(type="omprog" name="stats_exporter"
binary="/usr/bin/python -u /usr/local/bin/rsyslog_exporter.py -p 9292 -e 5 -d 120"
signalOnClose="on"
template="stats_exporter_tmpl"
)
}
Please note rsyslog_exporter.py command line parameters:
-etimeout should be small enough to export metrics faster but big enough to prevent export of unfinished data block. 5s looks fine (and it's default value).-dtimeout should be 2-3 times of impstat'sintervalvalue. 120s-180s is ok for config above.