Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): count silences per cluster, not instance #1829

Merged
merged 2 commits into from
Jun 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cmd/karma/views.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,14 @@ func silences(c *gin.Context) {
}
for _, alertGroup := range alertmanager.DedupAlerts() {
for _, alert := range alertGroup.Alerts {
clustersDone := map[string]bool{}
for _, am := range alert.Alertmanager {
for _, sID := range am.SilencedBy {
if _, ok := silenceCounters[sID]; ok {
silenceCounters[sID]++
if _, found := clustersDone[am.Cluster]; !found {
if _, ok := silenceCounters[sID]; ok {
silenceCounters[sID]++
clustersDone[am.Cluster] = true
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion ui/src/Components/Grid/AlertGrid/Swimlane.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ const Swimlane = ({ alertStore, grid, isExpanded, onToggle }) => {
return (
<Fade in={context.animations.in} duration={context.animations.duration}>
<h5 className="components-grid-swimlane d-flex flex-row justify-content-between rounded px-2 py-1 mt-2 mb-0 border border-dark">
<span className="flex-shrink-1 flex-grow-1" style={{ minWidth: "0px" }}>
<span className="flex-shrink-0 flex-grow-0">
<span className="badge components-label px-0 ml-1 mr-3">
<FontAwesomeIcon icon={faTh} className="text-muted" />
</span>
</span>
<span className="flex-shrink-1 flex-grow-1" style={{ minWidth: "0px" }}>
{grid.labelName !== "" && grid.labelValue !== "" && (
<FilteringLabel
key={grid.labelValue}
Expand Down