Closed simondeziel closed 1 year ago
The warning is legit: in this case the user needs to be explicit about the refresh event. Without an explicit refresh event, prometheus won't be able to keep track of any changes to IP.
On one hand, it isn't ERROR because it will work fine; on the other hand, INFO/DEBUG isn't drawing sufficient attention to the potential problem.
Oh, that might explain why scrape_jobs
gets reset pretty quickly. Any suggestion as to what kind of event I should be passing to refresh_event
for a machine charm?
Not sure. I suppose passing both start
and upgrade-charm
should cover it?
Thanks, that's much appreciated, let me try that out!
Actually from the the docs it seems that if you use start
you don't need upgrade-charm as well.
I appreciate your diligence! Unfortunately, that doesn't fix the problem of scrape_jobs
being reset "behind" by back.
That said, setting refresh_event=self.on.start
makes the log spam stop, so I'll close the bug as I was the lib wrong apparently.
Bug Description
If a machine charm uses the
MetricsEndpointProvider
fromcharms.prometheus_k8s.v0.prometheus_scrape
, the prometheus lib will keep complaining about having no container present inmetadata.yaml
.To Reproduce
MetricsEndpointProvider
fromcharms.prometheus_k8s.v0.prometheus_scrape
Environment
Relevant log output