Change #239812
Category | rsyslog |
Changed by | Rainer Gerhards <rgerhards | @adiscon.com>
Changed at | Tue 15 Jul 2025 12:29:06 |
Repository | https://github.com/rsyslog/rsyslog.git |
Project | rsyslog |
Branch | master |
Revision | 63c7e7d67d11499fc43db4cff7601c36b3fc4178 |
Comments
impstats: add support for Prometheus metrics output format This commit extends the impstats input module to support a new "prometheus" format for exporting statistics. The output is generated via statsobj.c, which already provides Prometheus- compatible formatting. To enable this, a new "format" config option value ("prometheus") was added and recognized by impstats.c. When selected, impstats invokes the appropriate statsobj function to generate output in Prometheus exposition format. The default behavior remains unchanged. Existing formats such as "json" and "legacy" are not modified. A new test has been added under tests/ to validate correct Prometheus output generation. The test verifies that the format header and at least one representative metric line conform to the Prometheus text format specification. This enhancement enables rsyslog to integrate more easily with Prometheus-based monitoring stacks and paves the way for native metrics scraping without external translation layers.
Changed files
- plugins/impstats/impstats.c
- tests/Makefile.am
- tests/stats-prometheus.sh