Prometheus targets gets removed when relating multiple endpoints

Hi, I have a problem when relating multiple endpoints to one prometheus instance using cross-model.

Every charm has two endpoints that I need to relate to. First application I relate goes as expected and adds the targets to prometheus.yaml

image

After relating a second endpoint from a different model, one of the previous target get removed.

image

And this goes on for every relation I make after this. If I instead remove a relation, another one gets implemented instead. For example, after removing the last related target with IP 192.168.161.22, the other target with IP 192.168.161.25 comes back.

image

The application I try to relate is Polkadot (source).

Does anyone know why this happens? I don’t know if the problem is on Prometheus2 charm or on Polkadot (interface_prometheus).

We posted this bug issue a couple of months ago. Could it be related to that?

@erik-lonroth @joakimnyman

2 Likes

We solved it by adding hostname before endpoint in the charm. :beers: