-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from theflockers/release_996
feat(RELEASE-996): availability metrics for release-service
- Loading branch information
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
rhobs/recording/release_service_availability_recording_rules.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: rhtap-release-service-availability | ||
labels: | ||
tenant: rhtap | ||
spec: | ||
|
||
groups: | ||
- name: release_service_general_availability | ||
interval: 1m | ||
rules: | ||
- record: konflux_up | ||
expr: | | ||
label_replace( | ||
avg(release_service_check_gauge) without(Name) OR | ||
label_replace( | ||
floor(sum(release_service_check_gauge) without(check) / count(release_service_check_gauge) without(check)), | ||
"check", "release", "", ""), | ||
"Name", "release_service_check_gauge", "", "") |
59 changes: 59 additions & 0 deletions
59
test/promql/tests/recording/release_service_availability_recording_rules_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
evaluation_interval: 1m | ||
|
||
rule_files: | ||
- release_service_availability_recording_rules.yaml | ||
|
||
tests: | ||
- interval: 1m | ||
name: RSExporterGithubTest | ||
input_series: | ||
- series: "release_service_check_gauge{service='release-service-availability-monitor-service1', check='github'}" | ||
values: "1 1 1 1 1" | ||
- series: "release_service_check_gauge{service='release-service-availability-monitor-service2', check='github'}" | ||
values: "0 0 0 0 0" | ||
- series: "release_service_check_gauge{service='release-service-availability-monitor-service3', check='github'}" | ||
values: "0 1 0 1 0" | ||
promql_expr_test: | ||
- expr: konflux_up | ||
eval_time: 5m | ||
exp_samples: | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service1', check='github'} | ||
value: 1 | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service2', check='github'} | ||
value: 0 | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service3', check='github'} | ||
value: 0 | ||
# need to check release as well because we are forcing it to be present by default | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service1', check='release'} | ||
value: 1 | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service2', check='release'} | ||
value: 0 | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service3', check='release'} | ||
value: 0 | ||
|
||
- interval: 1m | ||
name: RSExporterPyxisTest | ||
input_series: | ||
- series: "release_service_check_gauge{Name='release_service_check_gauge', service='release-service-availability-monitor-service1', check='pyxis'}" | ||
values: "1 1 1 1 1" | ||
- series: "release_service_check_gauge{Name='release_service_check_gauge', service='release-service-availability-monitor-service2', check='pyxis'}" | ||
values: "0 0 0 0 0" | ||
- series: "release_service_check_gauge{Name='release_service_check_gauge', service='release-service-availability-monitor-service3', check='pyxis'}" | ||
values: "0 1 0 1 0" | ||
promql_expr_test: | ||
- expr: konflux_up | ||
eval_time: 5m | ||
exp_samples: | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service1', check='pyxis'} | ||
value: 1 | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service2', check='pyxis'} | ||
value: 0 | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service3', check='pyxis'} | ||
value: 0 | ||
# need to check release as well because we are forcing it to be present by default | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service1', check='release'} | ||
value: 1 | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service2', check='release'} | ||
value: 0 | ||
- labels: konflux_up{Name='release_service_check_gauge', service='release-service-availability-monitor-service3', check='release'} | ||
value: 0 |