@@ -362,7 +362,7 @@ def _on_scrape_targets_changed(self, event):
362
362
363
363
# Increment this PATCH version before using `charmcraft publish-lib` or reset
364
364
# to 0 if you are raising the major API version
365
- LIBPATCH = 44
365
+ LIBPATCH = 46
366
366
367
367
PYDEPS = ["cosl" ]
368
368
@@ -521,8 +521,8 @@ def expand_wildcard_targets_into_individual_jobs(
521
521
# for such a target. Therefore labeling with Juju topology, excluding the
522
522
# unit name.
523
523
non_wildcard_static_config ["labels" ] = {
524
- ** non_wildcard_static_config .get ("labels" , {}),
525
524
** topology .label_matcher_dict ,
525
+ ** non_wildcard_static_config .get ("labels" , {}),
526
526
}
527
527
528
528
non_wildcard_static_configs .append (non_wildcard_static_config )
@@ -547,9 +547,9 @@ def expand_wildcard_targets_into_individual_jobs(
547
547
if topology :
548
548
# Add topology labels
549
549
modified_static_config ["labels" ] = {
550
- ** modified_static_config .get ("labels" , {}),
551
550
** topology .label_matcher_dict ,
552
551
** {"juju_unit" : unit_name },
552
+ ** modified_static_config .get ("labels" , {}),
553
553
}
554
554
555
555
# Instance relabeling for topology should be last in order.
@@ -1537,12 +1537,11 @@ def set_scrape_job_spec(self, _=None):
1537
1537
relation .data [self ._charm .app ]["scrape_metadata" ] = json .dumps (self ._scrape_metadata )
1538
1538
relation .data [self ._charm .app ]["scrape_jobs" ] = json .dumps (self ._scrape_jobs )
1539
1539
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 )
1546
1545
1547
1546
def _set_unit_ip (self , _ = None ):
1548
1547
"""Set unit host address.
0 commit comments