Skip to content

Commit 7ce8364

Browse files
authored
chore: Bump prometheus_scrape lib (#88)
* chore: Bump prometheus_scrape lib * Update requirements.in Ref canonical/bundle-kubeflow#880
1 parent 155b30a commit 7ce8364

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

lib/charms/prometheus_k8s/v0/prometheus_scrape.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def _on_scrape_targets_changed(self, event):
362362

363363
# Increment this PATCH version before using `charmcraft publish-lib` or reset
364364
# to 0 if you are raising the major API version
365-
LIBPATCH = 44
365+
LIBPATCH = 46
366366

367367
PYDEPS = ["cosl"]
368368

@@ -521,8 +521,8 @@ def expand_wildcard_targets_into_individual_jobs(
521521
# for such a target. Therefore labeling with Juju topology, excluding the
522522
# unit name.
523523
non_wildcard_static_config["labels"] = {
524-
**non_wildcard_static_config.get("labels", {}),
525524
**topology.label_matcher_dict,
525+
**non_wildcard_static_config.get("labels", {}),
526526
}
527527

528528
non_wildcard_static_configs.append(non_wildcard_static_config)
@@ -547,9 +547,9 @@ def expand_wildcard_targets_into_individual_jobs(
547547
if topology:
548548
# Add topology labels
549549
modified_static_config["labels"] = {
550-
**modified_static_config.get("labels", {}),
551550
**topology.label_matcher_dict,
552551
**{"juju_unit": unit_name},
552+
**modified_static_config.get("labels", {}),
553553
}
554554

555555
# Instance relabeling for topology should be last in order.
@@ -1537,12 +1537,11 @@ def set_scrape_job_spec(self, _=None):
15371537
relation.data[self._charm.app]["scrape_metadata"] = json.dumps(self._scrape_metadata)
15381538
relation.data[self._charm.app]["scrape_jobs"] = json.dumps(self._scrape_jobs)
15391539

1540-
if alert_rules_as_dict:
1541-
# Update relation data with the string representation of the rule file.
1542-
# Juju topology is already included in the "scrape_metadata" field above.
1543-
# The consumer side of the relation uses this information to name the rules file
1544-
# that is written to the filesystem.
1545-
relation.data[self._charm.app]["alert_rules"] = json.dumps(alert_rules_as_dict)
1540+
# Update relation data with the string representation of the rule file.
1541+
# Juju topology is already included in the "scrape_metadata" field above.
1542+
# The consumer side of the relation uses this information to name the rules file
1543+
# that is written to the filesystem.
1544+
relation.data[self._charm.app]["alert_rules"] = json.dumps(alert_rules_as_dict)
15461545

15471546
def _set_unit_ip(self, _=None):
15481547
"""Set unit host address.

requirements.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# Copyright 2021 Canonical Ltd.
22
# See LICENSE file for licensing details.
33
charmed-kubeflow-chisme >= 0.3.0
4-
# from observability_libs.v0.juju_topology.py
4+
# from prometheus_k8s.v0.prometheus_scrape.py
55
cosl
66
envoy_data_plane==0.2.5
7-
# from observability_libs.v0.juju_topology.py
8-
cosl
97
# if unpinned causes problems with installation resulting in module 'platform' has no attribute 'dist'
108
oci-image
119
ops

0 commit comments

Comments
 (0)