jonnenauha / prometheus_varnish_exporter

Varnish exporter for Prometheus
MIT License
177 stars 101 forks source link

Clean backend name if beginning with reload_ #56

Closed stromnet closed 5 years ago

stromnet commented 5 years ago

When using often-shipped scripts to reload varnish VCLs, the backend names changes from "boot" to reload_xxxxx.

Initially, metrics would be exported with default, then after one reload it would be reload_20191016_072034_54500.default.

The varnish_reload_vcl script as shipped with Varnish 4 packages uses one format, and varnishreload shipped with 6+ packages uses a slightly different. This covers both.

Note: this is my very first attempt on Go coding, so feel free to point out improvements!

jonnenauha commented 5 years ago

Looks good, thanks!

jonnenauha commented 5 years ago

Your PR is included in the 1.5.2 release, thanks for your contribution.

stromnet commented 5 years ago

Great, thank you!