canonical / grafana-agent-operator

https://charmhub.io/grafana-agent
Apache License 2.0
4 stars 10 forks source link

juju application label set with grafana agent application rather than principal application it is related to #68

Closed nishant-dash closed 6 months ago

nishant-dash commented 7 months ago

Bug Description

After relating grafana agent to a principal charm like charm microk8s or kubernetes which both have a cos agent interface, I see that the alert rules that finally show up in prometheus have their juju application label set to the grafana agent application rather than the principal application.

name: KubeletDown
expr: absent(up{job="kubelet",juju_application="grafana-agent-cos",juju_model="microk8s",juju_model_uuid="27e46ec4-e07f-4362-8597-d4e76c9bd00a",metrics_path="/metrics"} == 1)
for: 15m
labels:
  juju_application: microk8s
  juju_charm: grafana-agent
  juju_model: microk8s
  juju_model_uuid: 27e46ec4-e07f-4362-8597-d4e76c9bd00a
  severity: critical
annotations:
  description: Kubelet has disappeared from Prometheus target discovery.
  runbook_url: https://runbooks.prometheus-operator.dev/runbooks/kubernetes/kubeletdown
  summary: Target disappeared from Prometheus target discovery.

This ^ is with a latest version in latest/edge revision 64. Revision 28 seems to work so this seems like a possible regression?

There are some alerts that are host type alerts which appropriate have the juju application label set with grafana agent so this example above should not be confused with that.

To Reproduce

juju deploy microk8s --channel=1.28/stable
juju deploy grafana-agent --channel=latest/edge
juju relate microk8s:cos-agent grafana-agent:cos-agent

then check alert rules in prometheus

Environment

juju 3.3.3 grafana-agent latest/edge 64

Relevant log output

N/A

Additional context

No response