Anyone knows how to setup haproxy to get stats out of it?

Looking for help on how to get stats from Deploy Haproxy using Charmhub - The Open Operator Collection

The documentation claims that some “statsd” server can be used.

@martin-hilton seems to have worked with this code and might know?

The documentation could do with some updating here, but the recommended way to do this would be to deploy the telegraf subordinate charm:

juju deploy cs:haproxy
juju deploy cs:telegraf
juju relate telegraf:juju-info haproxy
juju relate telegraf:haproxy haproxy

You can then query http://${unit_ip}:9103/metrics to get a bunch of metrics.

I’ll work on getting the docs updated next week.

1 Like

This is awesome. It’s really useful for us trying to pursue some performance related issues

@joakimnyman

Would you be interested in joining me in a hands on workshop in a few weeks to demonstrate how the haproxy works with a website charm?

I hosted a getting started workshop today which was great fun. Also super valuable for people that can get a chance to learn how it works.

Have you seen this @mthaddon ? https://www.youtube.com/watch?v=MChtqyoagYk

I would say that operating haproxy via dataplane API would be highly desirable when configurations are getting more complex and Juju-configs via relation or configs starts getting out of hand…

Perhaps a subordinate or something would be useful here… Not sure how others are doing it.

Looks interesting. Will definitely bear that in mind for future changes to this charm.

1 Like

Totally. We use the dataplane API as the most flexible and reliant was to configure haproxy.

It supports transactional configuration as well which is very useful with complex configuration.

Furthermore it use inotify, so it picks up changes to file (manual) config as well.

@mthaddon we have built a haproxy charm with the dataplane-api now and plan to collaborate with @jamesbeedy team to get it to shape. Perhaps this would interest you. Its been of great value to us.

Interesting indeed. Can you point me at the charm and/or source code?

1 Like

Currently we are in the process to shape it up such that we can publish it, but if you send me your github name, I can add you as a collaborator. The repo is private still.

I can show you an example that push an entire config to it via the API.