canonical / grafana-agent-k8s-operator

This charmed operator automates the operational procedures of running Grafana Agent, an open-soruce telemetry collector.
https://charmhub.io/grafana-agent-k8s
Apache License 2.0
8 stars 18 forks source link

Fix label treatment of related charms #277

Closed sed-i closed 6 months ago

sed-i commented 6 months ago

Issue

This charm overwrites existing topology labels with its own topology labels. This happens because:

  1. This charm doesn't have cos-tool, so injection of label matchers is skipped.
  2. This charm has an outdated labeling logic: here, all alert labels are being replaced by this charm's labels, whereas in cos-lib only missing labels are added.
  3. This charm has two different use cases for rules that are currently not captured well:
    1. Like most charms, this charm has built-in rules and dashboards that need to be enriched with the charm's topology labels.
    2. Like cos-config, this charm needs to forward 3rd-party rules and dashboards without changing the labels.

Solution

Fixes #275.

Context

This PR goes in tandem with:

Testing Instructions

See https://github.com/canonical/loki-k8s-operator/pull/353.

Revision 61 of 'grafana-agent-k8s' released to edge/pr-277 (attaching resources: 'agent-image' r38)

Upgrade Notes

No change further action beyond juju refresh is needed – labels should be corrected after an upgrade.

sed-i commented 6 months ago

@rgildein if you're able to test this change,

Revision 61 of 'grafana-agent-k8s' released to edge/pr-277 (attaching resources: 'agent-image' r38)