mehdy / keepalived-exporter

Prometheus Keepalived exporter
GNU General Public License v3.0
121 stars 40 forks source link

feat: new metric to add exporter version #112

Closed dmachard closed 1 year ago

dmachard commented 1 year ago

This PR add a new metric to follow up the version of this exporter. No breaking changes.

dmachard commented 1 year ago

I will take a look

dmachard commented 1 year ago

Thank for the tip, you are right it's more cleaner. Below the new metrics with prometheus version package.

# HELP keepalived_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which keepalived_exporter was built.
keepalived_exporter_build_info{branch="",goversion="go1.18.1",revision="",version="689046e"} 1
dmachard commented 1 year ago

done, updated output version:

$ ./keepalived-exporter -version
INFO[0000] Keepalived Exporter                           build_time="2023-04-19_08:43:43_+0200" commit=9c200ce version=9c200ce
# HELP keepalived_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which keepalived_exporter was built.
keepalived_exporter_build_info{branch="feat-add-version",goversion="go1.18.1",revision="9c200ce",version="9c200ce"} 1