Extends AlertmanagerCharm.self_scraping_job() to include all units, not just the leader, for metrics scraping.
Testing Instructions
juju deploy prometheus-k8s --channel edge --trust
charmcraft pack
juju deploy ./*.charm --resource alertmanager-image=ubuntu/alertmanager:0-22.04 --trust
juju relate alertmanager-k8s:self-metrics-endpoint prometheus-k8s
# wait for things to settle
jhack show-relation alertmanager-k8s prometheus-k8s
# Should see a single target provided
juju scale-application alertmanager-k8s 3
# wait for things to settle
jhack show-relation alertmanager-k8s prometheus-k8s
# Should see a target for each unit
# Check if prometheus has the targets
curl $PROMETHEUS_IP:9090/api/v1/targets \
| jq '.data.activeTargets | .[] | {scrapeUrl, health}'
# should see a target for each am unit (plus one for prometheus)
Upgrade Notes
Upgrade should happen seemlessly. Nothing has changed to affect upgrades
Issue
closes #151
Solution
Extends AlertmanagerCharm.self_scraping_job() to include all units, not just the leader, for metrics scraping.
Testing Instructions
Upgrade Notes
Upgrade should happen seemlessly. Nothing has changed to affect upgrades