You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more of a question/feature request than an issue.
So, we run Varnish in a Docker container, and we have a go binary that we use as the entry point to run varnish and handle VCL updates and a few other things. One of the other things it does is provide a Prometheus exporter for some internal metrics. We were running the prometheus_varnish_exporter as a separate process, but having two exporters on different ports seemed redundant and made for overcomplicating our Prometheus scrape configs.
So we looked at how we could include the Prometheus metrics in the same exporter. I couldn't see an easy way to include the prometheus_varnish_exporter metrics in an existing exporter's registry. All the logic exists in the main module and go won't let you import another main module into your own.
So for now what I've done is to fork and move the metrics collection logic into a sub-module (see section-io@48922e4). That way we can just import the github.com/jonnenauha/prometheus_varnish_exporter/varnishexporter module (sorry, naming is hard) to then publish those metrics in the current exporter we use. This could probably be done better. I'm not thrilled with the separation of responsibilities between the main and varnishexporter modules. For example, there's no reason for the submodule to know about the HealthPath property, but I was trying to limit the changes in this first pass.
So I guess I have two questions:
Is there a better way to get access to the Varnish metrics provided by this module in the context of another go binary and existing Prometheus exporter?
If not, would you be interested in having this submodule pattern merged upstream into this repository?
The text was updated successfully, but these errors were encountered:
Any
1.5.1
This is more of a question/feature request than an issue.
So, we run Varnish in a Docker container, and we have a
go
binary that we use as the entry point to run varnish and handle VCL updates and a few other things. One of the other things it does is provide a Prometheus exporter for some internal metrics. We were running the prometheus_varnish_exporter as a separate process, but having two exporters on different ports seemed redundant and made for overcomplicating our Prometheus scrape configs.So we looked at how we could include the Prometheus metrics in the same exporter. I couldn't see an easy way to include the prometheus_varnish_exporter metrics in an existing exporter's registry. All the logic exists in the
main
module and go won't let you import anothermain
module into your own.So for now what I've done is to fork and move the metrics collection logic into a sub-module (see section-io@48922e4). That way we can just import the
github.com/jonnenauha/prometheus_varnish_exporter/varnishexporter
module (sorry, naming is hard) to then publish those metrics in the current exporter we use. This could probably be done better. I'm not thrilled with the separation of responsibilities between themain
andvarnishexporter
modules. For example, there's no reason for the submodule to know about theHealthPath
property, but I was trying to limit the changes in this first pass.So I guess I have two questions:
The text was updated successfully, but these errors were encountered: