Skip to content

Commit 8202ea2

Browse files
authored
Add logs (#20)
1 parent 7d24f33 commit 8202ea2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/dev/vality/alerting/mayday/prometheus/client/k8s/util/PrometheusFunctionsUtil.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public static UnaryOperator<PrometheusRule> getRemoveGroupByNameFunc(String grou
3333
public static UnaryOperator<PrometheusRule> getRemoveAlertByGroupAndNameFunc(String groupName,
3434
String alertNameForRemoval) {
3535
return prometheusRule -> {
36+
log.info("Rule before removal: {}", prometheusRule);
3637
log.info("Going to remove alert '{}' for user '{}'", alertNameForRemoval, groupName);
3738
var groups = prometheusRule.getSpec().getGroups();
3839
var groupIterator = groups.iterator();
@@ -54,10 +55,12 @@ public static UnaryOperator<PrometheusRule> getRemoveAlertByGroupAndNameFunc(Str
5455
log.info("User '{}'has no more rules and will be removed!", group.getName());
5556
groupIterator.remove();
5657
}
58+
log.info("Rule after removal: {}", prometheusRule);
5759
return prometheusRule;
5860
}
5961
}
6062
}
63+
log.info("Nothing was removed: {}", prometheusRule);
6164
return prometheusRule;
6265
};
6366
}

0 commit comments

Comments
 (0)