Alert rule querys invalid label

Hi! We’re tinkering around with a grafana-agent and charm @erik-lonroth created, one thing I noticed was that the added alert rule gets a strange label implemented to it. It points to “juju_charm” which results in no query data. It should be searching for “juju_unit” instead. How do I change this? or is it a bug?

Alert rule from microsample charm

See graph

Btw, I don’t know if this is the right place to put this question. If so is the case, please reply where I could ask this kind of questions.

Could this be the issue @0x12b since the topology container “juju_charm” where there is no such key in the topology?

there should be such a label in the topology, and if there isn’t, that’s likely a bug. in that case, could you please report it in the grafana-agent-k8s-operator repo on github?

juju_charm is the name of the charm, regardless of what you named the application. so even if you do juju deploy observed min-fina-charm it would still be observed.

juju_unit you almost certainly don’t want in your selectors as that means that if you scale the application to multiple units, it will still only trigger on the one that matches the juju_unit.