repos / ops

infra for pico services
git clone https://github.com/picosh/ops.git

ops / monitoring / grafana / config / provisioning / alerting
Antonio Mika · 05 Nov 23

https.yml

  1apiVersion: 1
  2
  3groups:
  4  - orgId: 1
  5    name: HTTPS
  6    folder: Default
  7    interval: 60s
  8    rules:
  9      - id: 1
 10        uid: 7pOZR7x4z
 11        orgID: 1
 12        folderUID: wLZWgnbVz
 13        ruleGroup: HTTPS
 14        title: Certificate Expiration
 15        condition: C
 16        data:
 17        - refId: A
 18          queryType: ''
 19          relativeTimeRange:
 20            from: 600
 21            to: 0
 22          datasourceUid: PBFA97CFB590B2093
 23          model:
 24            editorMode: code
 25            expr: floor((probe_ssl_earliest_cert_expiry - time()) / (3600 * 24))
 26            hide: false
 27            intervalMs: 1000
 28            legendFormat: __auto
 29            maxDataPoints: 43200
 30            range: true
 31            refId: A
 32        - refId: B
 33          queryType: ''
 34          relativeTimeRange:
 35            from: 600
 36            to: 0
 37          datasourceUid: "-100"
 38          model:
 39            conditions:
 40            - evaluator:
 41                params:
 42                - 0
 43                - 0
 44                type: gt
 45              operator:
 46                type: and
 47              query:
 48                params: []
 49              reducer:
 50                params: []
 51                type: avg
 52              type: query
 53            datasource:
 54              name: Expression
 55              type: __expr__
 56              uid: __expr__
 57            expression: A
 58            intervalMs: 1000
 59            maxDataPoints: 43200
 60            reducer: last
 61            refId: B
 62            settings:
 63              mode: dropNN
 64            type: reduce
 65        - refId: C
 66          queryType: ''
 67          relativeTimeRange:
 68            from: 600
 69            to: 0
 70          datasourceUid: "-100"
 71          model:
 72            conditions:
 73            - evaluator:
 74                params:
 75                - 20
 76                - 0
 77                type: lt
 78              operator:
 79                type: and
 80              query:
 81                params: []
 82              reducer:
 83                params: []
 84                type: avg
 85              type: query
 86            datasource:
 87              name: Expression
 88              type: __expr__
 89              uid: __expr__
 90            expression: B
 91            intervalMs: 1000
 92            maxDataPoints: 43200
 93            refId: C
 94            type: threshold
 95        updated: '2023-02-24T20:29:12Z'
 96        noDataState: Alerting
 97        execErrState: Alerting
 98        for: 1m
 99        annotations:
100          description: The certificate for {{ $labels.instance }} will expire in {{ $values.B
101            }} days
102          summary: The certificate for {{ $labels.instance }} will expire in {{ $values.B
103            }} days
104      - id: 3
105        uid: XqLjDnx4k
106        orgID: 1
107        folderUID: wLZWgnbVz
108        ruleGroup: HTTPS
109        title: HTTPS Status
110        condition: C
111        data:
112        - refId: A
113          queryType: ''
114          relativeTimeRange:
115            from: 600
116            to: 0
117          datasourceUid: PBFA97CFB590B2093
118          model:
119            editorMode: code
120            expr: probe_success{job=~"blackbox_exporter_https_.*"}
121            hide: false
122            intervalMs: 1000
123            legendFormat: __auto
124            maxDataPoints: 43200
125            range: true
126            refId: A
127        - refId: B
128          queryType: ''
129          relativeTimeRange:
130            from: 600
131            to: 0
132          datasourceUid: "-100"
133          model:
134            conditions:
135            - evaluator:
136                params: []
137                type: gt
138              operator:
139                type: and
140              query:
141                params:
142                - B
143              reducer:
144                params: []
145                type: last
146              type: query
147            datasource:
148              type: __expr__
149              uid: "-100"
150            expression: A
151            hide: false
152            intervalMs: 1000
153            maxDataPoints: 43200
154            reducer: last
155            refId: B
156            type: reduce
157        - refId: C
158          queryType: ''
159          relativeTimeRange:
160            from: 600
161            to: 0
162          datasourceUid: "-100"
163          model:
164            conditions:
165            - evaluator:
166                params:
167                - 1
168                type: lt
169              operator:
170                type: and
171              query:
172                params:
173                - C
174              reducer:
175                params: []
176                type: last
177              type: query
178            datasource:
179              type: __expr__
180              uid: "-100"
181            expression: B
182            hide: false
183            intervalMs: 1000
184            maxDataPoints: 43200
185            refId: C
186            type: threshold
187        updated: '2023-02-24T20:29:12Z'
188        noDataState: NoData
189        execErrState: Error
190        for: 1m
191        annotations:
192          description: HTTPS is inaccessible for {{ $labels.instance }}
193          summary: HTTPS is inaccessible for {{ $labels.instance }}