canonical / cos-configuration-k8s-operator

This charmed operator for Kubernetes enables you to provide configurations to various components of the Canonical Observability Stack (COS) bundle.
https://charmhub.io/cos-configuration-k8s
Apache License 2.0
4 stars 5 forks source link

changing some charm configs does not push new alert rules into relation data with prometheus #80

Open nishant-dash opened 5 months ago

nishant-dash commented 5 months ago

Bug Description

the data bag gets emptied out

    "endpoint": "metrics-endpoint",
    "related-endpoint": "prometheus-config",
    "application-data": {
      "alert_rules": "{}"
    },

I checked the cos-configuration pod and I see it successfully pulled in the the data from github.

To Reproduce

  1. juju deploy cos and cos coniguration
  2. set cos config charm configs
  3. relate cos config and cos
  4. change charm configs for
    git_repo
    git_branch
    prometheus_alert_rules_path

Environment

cos    manual-controller  microk8s-cloud/localhost  3.1.7    unsupported  16:05:57Z
...
cos-configuration  3.5.0    active      1  cos-configuration-k8s  latest/stable   42 ...
prometheus         2.47.2   active      1  prometheus-k8s         stable         159 ...
...

Relevant log output

N/A

Additional context

No response

lucabello commented 1 week ago

We should solve this by integrating COS Config with Prometheus via a metrics endpoint relation, and make sure to pass config_changed in the refresh events.

Not closing this yet, but the implementation should happen in #8.