relating to haproxy doesn't work

Bug #1931150 reported by Junien Fridrick
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Telegraf Charm
Medium
Unassigned

Bug Description

This is somewhat related to bug 1910974, which is actually still not fixed from what I can see.

On an AWS model, the relation data returned by haproxy will look like :

egress-subnets: 172.31.6.123/32
enabled: "True"
ingress-address: 172.31.6.123
password: REDACTED
port: "10000"
private-address: 172.31.6.123
user: haproxy

And the current telegraf code does :

addr = rel.get("listener-address", rel["private-address"])

So the telegraf charm will be configured to check the haproxy statistics via 172.31.6.123:10000.

But, by default, haproxy only allows 127.0.0.1/32 to query the statistics. And so connections to 172.31.6.123 fail.

As @hloeung said in bug 1910974, this is a subordinate charm, so why use anything else than 127.0.0.1 ?

At the very least, the telegraf charm should try actually fetching metrics, and if it doesn't work with the relation data then it should try with 127.0.0.1, and use that if it works.

Thanks

Revision history for this message
Junien Fridrick (axino) wrote :

Also, the haproxy_input() function is gated with :

@when("haproxy.available")
@when("telegraf.installed")
def haproxy_input(haproxy):

So it will be called for every single hook if haproxy is related. We should gate it with a flag that's set at the end of this function ("haproxy.input.configured" or something) and unset this flag where appropriate ("config-changed" etc...)

Edin S (exsdev)
Changed in charm-telegraf:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers