Closed sed-i closed 2 years ago
Add support for cross-controller/cross-cloud prometheus_scrape
relation?
The scraping relation was originally intended for in-model use only, with the idea that from a topology standpoint the correct approach is remote-write with grafana agent.
However, it should still be possible to use the prometheus_scrape relation cross-controller/cross-cloud.
bind_address
One option is to go back to using bind_address
. However, there is still a juju bug for which occasionally ops ends up returning None for bind_address
(on launchpad it is marked as "fix released" but the bug is still there), making the charm startup as long as the update-status hook interval in some cases.
external_url
Another option could be to add an optional argument, e.g. external_url
to the MetricsEndpointProvider
constructor, so users could pass it bind_address
or their charm's self.ingress.url
themselves.
Would need to rethink the *-notation, because we would need the external_url
of every unit. One option is to have every unit update peer relation data.
One option is to have every unit update peer relation data.
We can't really demand that the remote charm implements this though.
However, it should still be possible to use the prometheus_scrape relation cross-controller/cross-cloud.
I'm not sure about this. As I expressed at the end of our last conversation, I'm somewhat opposed to the whole idea of cross-controller scrapes. I think the "right" solution here also is the only actually viable solution.
We can't really demand that the remote charm implements this though.
Agreed, that is something prometheus_scrape
would have to do on behalf of the charm.
I'm somewhat opposed to the whole idea of cross-controller scrapes. I think the "right" solution here also is the only actually viable solution.
I wonder if we can detect a cross model relation and block with e.g. "Not supported; use remote-write instead".
A PR reverting back to using bind_address
by default and falling back to fqdn()
is available here.
Bug Description
293 replaced
network.bind_address()
withsocket.getfqdn()
. This works for in-model relations but breaks for cross-cluster relations.cc: @mateoflorido @stonepreston
To Reproduce
Form a cross-cluster prometheus_scrape relation b/w a machine charm and the prometheus-k8s charm.
Environment
Relevant log output
Additional context
No response