plugins icon indicating copy to clipboard operation
plugins copied to clipboard

net/haproxy: Allow exporting prometheus metrics

Open onedr0p opened this issue 3 years ago • 5 comments

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

[x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md

[x] I have searched the existing issues and I'm convinced that mine is new.

[x] When the request is meant for an existing plugin, I've added its name to the title.

Is your feature request related to a problem? Please describe.

I would like to gather metrics from haproxy with prometheus.

Describe the solution you'd like

Haproxy has native support for a prometheus endpoint, see this blog post for more detail.

It would be cool to have this configurable in the UI.

Describe alternatives you've considered

n/a

Additional context

n/a

onedr0p avatar Jan 22 '22 09:01 onedr0p

Instead of pointing to a rather lengthy blog post, would you please describe the options you would like to see in OPNsense?

fraenki avatar Jan 22 '22 22:01 fraenki

Sure, it would be nice to have an option on the haproxy stats menu to turn on the metrics endpoint, which looks like the option would configure this http-request line in the config below.

frontend stats
   bind *:8404
   option http-use-htx
   # This line below turns on prometheus metrics
   http-request use-service prometheus-exporter if { path /metrics }
   stats enable
   stats uri /stats
   stats refresh 10s

onedr0p avatar Jan 22 '22 23:01 onedr0p

This issue has been automatically timed-out (after 180 days of inactivity).

For more information about the policies for this repository, please read https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md for further details.

If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.

OPNsense-bot avatar Jul 21 '22 08:07 OPNsense-bot

@fraenki did you want to take this maybe?

fichtner avatar Jul 21 '22 08:07 fichtner

Maybe. I'll reopen it.

fraenki avatar Jul 21 '22 20:07 fraenki

The next version of the HAProxy plugin will include two ways to enable a Prometheus exporter:

  • Settings -> Statistics – a simple one-click option
  • Virtual Services -> Public Services – an advanced option (hidden by default) with all frontend customization options

fraenki avatar Oct 21 '22 23:10 fraenki