Skip to content

Commit

Permalink
Use unit.name in the alrt rule generation, not plain 'nrpe' (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarry82 authored Jan 21, 2023
1 parent 0a8c22e commit 7d42c5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/charms/nrpe_exporter/v0/nrpe_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def _generate_alert(self, relation, cmd, id, unit) -> dict:
"juju_application": re.sub(r"^(.*?)[-_]\d+$", r"\1", id.replace("_", "-")),
"juju_unit": re.sub(r"^(.*?)[-_](\d+)$", r"\1/\2", id.replace("_", "-")),
"nrpe_application": relation.app.name,
"nrpe_unit": unit,
"nrpe_unit": unit.name,
},
"annotations": {
"summary": "Unit {{ $labels.juju_unit }}: {{ $labels.command }} critical.",
Expand Down

0 comments on commit 7d42c5c

Please sign in to comment.