Skip to content

Commit

Permalink
controller: add context label
Browse files Browse the repository at this point in the history
  • Loading branch information
talal committed Aug 21, 2020
1 parent 27a1752 commit 65bdd27
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.5.0] - 2020-08-21

## Added

- `context` label to absent alerts.

## [0.4.0] - 2020-08-20

## Removed

- `playbook` label.
- `playbook` label from absent alerts.

## [0.3.0] - 2020-08-20

Expand All @@ -35,7 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release.

[unreleased]: https://github.com/sapcc/absent-metrics-operator/compare/v0.4.0...HEAD
[unreleased]: https://github.com/sapcc/absent-metrics-operator/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/sapcc/absent-metrics-operator/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/sapcc/absent-metrics-operator/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/sapcc/absent-metrics-operator/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/sapcc/absent-metrics-operator/compare/v0.1.0...v0.2.0
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ alert: AbsentFooBar
expr: absent(foo_bar)
for: 10m
labels:
context: absent-metrics
severity: info
tier: network
service: foo
Expand Down Expand Up @@ -135,6 +136,7 @@ alert: $name
expr: absent($metric)
for: 10m
labels:
context: absent-metrics
severity: info
tier: $tier
service: $service
Expand All @@ -159,7 +161,8 @@ can be referenced on how to deal with absent metric alerts.

The following labels are always present on every absent metric alert rule:

- `severity` is alway `info`.
- `severity` is `info`.
- `context` is `absent-metrics`.

#### Carry over from original alert rule

Expand Down
1 change: 1 addition & 0 deletions internal/controller/alert_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func (c *Controller) ParseAlertRule(defaultTier, defaultService string, in monit

// Default labels
lab := map[string]string{
"context": "absent-metrics",
"severity": "info",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var kepLab = map[string]string{
"tier": "os",
"service": "keppel",
"severity": "info",
"context": "absent-metrics",
}

// ResMgmtK8sAbsentPromRule represents the PrometheusRule that should be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var limesLab = map[string]string{
"tier": "os",
"service": "limes",
"severity": "info",
"context": "absent-metrics",
}

// ResMgmtOSAbsentPromRule represents the PrometheusRule that should be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var swiftLab = map[string]string{
"tier": "os",
"service": "swift",
"severity": "info",
"context": "absent-metrics",
}

// SwiftOSAbsentPromRule represents the PrometheusRule that should be generated
Expand Down

0 comments on commit 65bdd27

Please sign in to comment.