Last active
March 31, 2020 15:50
-
-
Save rolandvarga/624a8258d50109d14ed319e950092e0d to your computer and use it in GitHub Desktop.
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
groups: | |
- name: SLA Recording Rules | |
rules: | |
- record: with_silence:virtual_machine_up:bool | |
expr: sum(avg_over_time(with_silence:virtual_machine_up:bool{tag_monitoring="enabled"}[30d])) / count(avg_over_time(with_silence:virtual_machine_up:bool{tag_monitoring="enabled"}[30d])) | |
- record: with_silence:virtual_machine_up:bool | |
expr: > | |
(( | |
sum by(resource_group, resource_name) | |
(virtual_machine_up) | |
+ | |
sum by(resource_group, resource_name) | |
(alertmanager_silence_info) | |
OR | |
sum by(resource_group, resource_name) | |
(virtual_machine_up) | |
) >= bool 1) * on (resource_group, resource_name) group_left(resource_type, tag_client_name, tag_monitoring) | |
mock_tag_info{resource_type="Microsoft.Compute/virtualMachines", exported_instance="prometheus-mock-exporter"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment