canonical / prometheus-scrape-config-k8s-operator

https://charmhub.io/prometheus-scrape-config-k8s
Apache License 2.0
1 stars 1 forks source link

Fix relabel key name #46

Closed sed-i closed 5 months ago

sed-i commented 6 months ago

Issue

Before this PR, during the config.yaml had the wrong key: metrics_relabel_configs (metrics in plural). The correct key is metric_relabel_configs (metric, in singular).

As a result, we were generating an invalid config that prometheus was dropping.

In addition, the yaml string wasn't parsed into a python object.

Solution

In tandem with:

Testing

$ juju config sc metric_relabel_configs="$(cat <<EOF
- source_labels: ["__name__"]
  regex: "go_gc_.+"
  action: "drop"
EOF
)"
sed-i commented 5 months ago

Shouldn't we have a test that checks this configuration in Prometheus?

https://github.com/canonical/cos-lite-bundle/issues/107