├── LICENSE ├── README.md ├── docs ├── onzack-cluster-monitoring.png ├── onzack-falco-monitoring.png ├── onzack-longhorn-monitoring.png ├── onzack-namespace-monitoring.png ├── onzack-opnsense-ids-monitoring.png ├── onzack-systemd-monitoring.png └── onzack-velero-monitoring.png ├── grafana ├── blackbox-exporter │ └── prometheus-blackbox-exporter.json ├── falco │ └── onzack-falco-monitoring.json ├── gitlab-ci-pipelines-exporter │ ├── environments.json │ └── pipelines.json ├── kubernetes │ ├── with-recording-rules │ │ ├── standard-cluster-monitoring.json │ │ └── standard-namespace-monitoring.json │ └── without-recording-rules │ │ ├── onzack-cluster-monitoring.json │ │ └── onzack-namespace-monitoring.json ├── longhorn │ └── onzack-longhorn-monitoring.json ├── opnsense │ └── onzack-opnsense-ids-monitoring.json ├── systemd │ └── onzack-systemd-monitoring.json ├── velero │ └── onzack-velero-monitoring.json └── vpa │ └── onzack-vpa-recommendations.json └── prometheus └── recording-rules ├── README.md ├── onzack-cluster-monitoring-recording-rules.yaml ├── onzack-namespace-monitoring-recording-rules-openshift-workaround.yaml └── onzack-namespace-monitoring-recording-rules.yaml /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Grafana Dashboards 2 | ONZACK Grafana Dashboards for Kubernetes, OpenShift and other systems. 3 | 4 | ## Kubernetes / OpenShift Base Monitoring 5 | ONZACK worked with LGT Bank in Liechtenstein to create two Grafana dashboards for Kubernetes and OpenShift. LGT Bank and ONZACK have agreed to make the dashboards available to the Kubernetes and OpenShift community so that everyone can benefit from the dashboards. ONZACK will continue to maintain and develop the dashboards in the future. 6 | 7 | ### Cluster Monitoring 8 | ![ONZACK Cluster Monitoring](https://github.com/onzack/grafana-dashboards/blob/main/docs/onzack-cluster-monitoring.png) 9 | 10 | - [Download](https://github.com/onzack/grafana-dashboards/blob/main/grafana/kubernetes/without-recording-rules/onzack-cluster-monitoring.json) ONZACK Cluster Monitoring Dashboard without recording rules 11 | - [Download](https://github.com/onzack/grafana-dashboards/blob/main/grafana/kubernetes/with-recording-rules/standard-cluster-monitoring.json) ONZACK Cluster Monitoring Dashboard with recording rules 12 | - [Download](https://github.com/onzack/grafana-dashboards/blob/main/prometheus/recording-rules/onzack-cluster-monitoring-recording-rules.yaml) Prometheus Recording Rules for ONZACK Cluster Monitoring Dashboard 13 | 14 | #### Troubleshooting 15 | - When using our dashboard with kube-prometheus-stack installed with helm and the custom rules are installed as yaml files, set `ruleSelectorNilUsesHelmValues: false` in the values.yaml for prometheus to load them. 16 | - Make sure your nodes are labeled correctly: 17 | ``` 18 | kubectl label node node-role.kubernetes.io/worker=worker 19 | kubectl label node node-role.kubernetes.io/control-plane=control-plane 20 | ``` 21 | 22 | ### Namespace Monitoring 23 | ![ONZACK Namespace Monitoring](https://github.com/onzack/grafana-dashboards/blob/main/docs/onzack-namespace-monitoring.png) 24 | 25 | - [Download](https://github.com/onzack/grafana-dashboards/blob/main/grafana/kubernetes/without-recording-rules/onzack-namespace-monitoring.json) ONZACK Namespace Monitoring Dashboard without recording rules 26 | - [Download](https://github.com/onzack/grafana-dashboards/blob/main/grafana/kubernetes/with-recording-rules/standard-namespace-monitoring.json) ONZACK Namespace Monitoring Dashboard with recording rules 27 | - [Download](https://github.com/onzack/grafana-dashboards/blob/main/prometheus/recording-rules/onzack-namespace-monitoring-recording-rules.yaml) Prometheus Recording Rules for ONZACK Namespace Monitoring Dashboard 28 | 29 | ## Falco Monitoring 30 | ![ONZACK Falco Monitoring](https://github.com/onzack/grafana-dashboards/blob/main/docs/onzack-falco-monitoring.png) 31 | 32 | Falco, the cloud-native runtime security project, is the de facto Kubernetes threat detection engine. 33 | This dashboard gives a good overview of the events generated by Falco. 34 | 35 | ### Prerequisites 36 | - [Falco](https://falco.org/) 37 | - [Falcosidekick](https://github.com/falcosecurity/falcosidekick) -> to ship the Falco events to Loki 38 | - [Loki](https://github.com/grafana/loki) (Datasource) 39 | 40 | ## Longhorn Monitoring 41 | ![ONZACK Longhorn Monitoring](https://github.com/onzack/grafana-dashboards/blob/main/docs/onzack-longhorn-monitoring.png) 42 | 43 | Longhorn is a distributed block storage system for Kubernetes. This dashboard has been built to serve as an example for monitoring the Longhorn storage system. 44 | 45 | ### Prerequisites 46 | - [Longhorn](https://longhorn.io) 47 | - Prometheus [ServiceMonitor](https://longhorn.io/docs/1.3.1/monitoring/integrating-with-rancher-monitoring/) for Longhorn 48 | - Add Longhorns example [PrometheusRules (Alerting Rules)](https://longhorn.io/docs/1.3.1/monitoring/alert-rules-example/) 49 | 50 | ## OPNsense & IDS/IPS Monitoring 51 | ![ONZACK OPNsense Monitoring](https://github.com/onzack/grafana-dashboards/blob/main/docs/onzack-opnsense-ids-monitoring.png) 52 | 53 | Dashboards to monitor Firewall Rules & IDS/IPS potential Attacks. 54 | 55 | ### Prerequisites 56 | - Loadbalancer to create virtual IP and to publish syslog ports (for example [MetalLB](https://metallb.universe.tf/)) 57 | - Promtail or Grafana Agent to listen on these ports and ship the logs to Loki 58 | - Loki to index the logs 59 | - Grafana to visualize the logs (datasource Loki configured) 60 | - OPNsense syslog target configured 61 | 62 | The Grafana Dashboard only works when your OPNsense IDS/IPS logs has a label ```job: syslog-ids``` and all other Firewall logs has a label ```job: syslog```. 63 | 64 | Promtail Helm chart example values: 65 | 66 | ```yaml 67 | config: 68 | lokiAddress: "http://loki-gateway/loki/api/v1/push" 69 | snippets: 70 | extraScrapeConfigs: | 71 | # Add an additional scrape config for syslog 72 | - job_name: syslog 73 | syslog: 74 | listen_address: 0.0.0.0:514 75 | idle_timeout: 60s 76 | label_structured_data: yes 77 | labels: 78 | job: "syslog" 79 | relabel_configs: 80 | - source_labels: ['__syslog_message_hostname'] 81 | target_label: 'host' 82 | # Add an additional scrape config for OPNsense IDS alerts shipped over syslog 83 | - job_name: syslog-ids 84 | syslog: 85 | listen_address: 0.0.0.0:1514 86 | idle_timeout: 60s 87 | label_structured_data: yes 88 | labels: 89 | job: "syslog-ids" 90 | relabel_configs: 91 | - source_labels: ['__syslog_message_hostname'] 92 | target_label: 'host' 93 | 94 | extraPorts: 95 | # Add an additional port for syslog 96 | # serviceType "LoadBalancer" only works if you have deployed an Loadbalancer for example MetalLB 97 | syslog: 98 | name: tcp-syslog 99 | containerPort: 514 100 | protocol: TCP 101 | service: 102 | type: LoadBalancer 103 | #clusterIP: null 104 | port: 514 105 | #externalIPs: [] 106 | #nodePort: 32682 107 | #annotations: {} 108 | #labels: {} 109 | #loadBalancerIP: null 110 | #loadBalancerSourceRanges: [] 111 | #externalTrafficPolicy: null 112 | # Add an additional port for OPNsense IDS alerts shipped over syslog 113 | # serviceType "LoadBalancer" only works if you have deployed an Loadbalancer for example MetalLB 114 | syslog-ids: 115 | name: tcp-syslog-ids 116 | containerPort: 1514 117 | protocol: TCP 118 | service: 119 | type: LoadBalancer 120 | #clusterIP: null 121 | port: 1514 122 | #externalIPs: [] 123 | #nodePort: 32682 124 | #annotations: {} 125 | #labels: {} 126 | #loadBalancerIP: null 127 | #loadBalancerSourceRanges: [] 128 | #externalTrafficPolicy: null 129 | ``` 130 | 131 | ## Velero Monitoring 132 | ![ONZACK Velero Monitoring](https://github.com/onzack/grafana-dashboards/blob/main/docs/onzack-velero-monitoring.png) 133 | 134 | Velero is an open source tool to safely backup and restore, perform disaster recovery, and migrate Kubernetes cluster resources and persistent volumes. 135 | This dashboard gives a good overview of the events and performance of Velero. 136 | 137 | ### Prerequisites 138 | - [Velero](https://velero.io) 139 | 140 | ## Systemd Monitoring 141 | ![ONZACK Systemd Monitoring](https://github.com/onzack/grafana-dashboards/blob/main/docs/onzack-systemd-monitoring.png) 142 | 143 | Monitor state of systemd services running on the node. 144 | 145 | ### Prerequisites 146 | - Node Exporter with Systemd collector enabled (Note: in order to collect metrics you need to mount /var/run/dbus/system_bus_socket into node-exporter and allow read access in Apparmor, if enabled) 147 | 148 | # Licence 149 | Copyright 2023 ONZACK AG 150 | 151 | Licensed under the Apache License, Version 2.0 (the "License"); 152 | you may not use this file except in compliance with the License. 153 | You may obtain a copy of the License at 154 | 155 | http://www.apache.org/licenses/LICENSE-2.0 156 | 157 | Unless required by applicable law or agreed to in writing, software 158 | distributed under the License is distributed on an "AS IS" BASIS, 159 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 160 | See the License for the specific language governing permissions and 161 | limitations under the License. 162 | -------------------------------------------------------------------------------- /docs/onzack-cluster-monitoring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onzack/grafana-dashboards/a38de49b9b76fa6889f4e05886bb5afc913f5395/docs/onzack-cluster-monitoring.png -------------------------------------------------------------------------------- /docs/onzack-falco-monitoring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onzack/grafana-dashboards/a38de49b9b76fa6889f4e05886bb5afc913f5395/docs/onzack-falco-monitoring.png -------------------------------------------------------------------------------- /docs/onzack-longhorn-monitoring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onzack/grafana-dashboards/a38de49b9b76fa6889f4e05886bb5afc913f5395/docs/onzack-longhorn-monitoring.png -------------------------------------------------------------------------------- /docs/onzack-namespace-monitoring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onzack/grafana-dashboards/a38de49b9b76fa6889f4e05886bb5afc913f5395/docs/onzack-namespace-monitoring.png -------------------------------------------------------------------------------- /docs/onzack-opnsense-ids-monitoring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onzack/grafana-dashboards/a38de49b9b76fa6889f4e05886bb5afc913f5395/docs/onzack-opnsense-ids-monitoring.png -------------------------------------------------------------------------------- /docs/onzack-systemd-monitoring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onzack/grafana-dashboards/a38de49b9b76fa6889f4e05886bb5afc913f5395/docs/onzack-systemd-monitoring.png -------------------------------------------------------------------------------- /docs/onzack-velero-monitoring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onzack/grafana-dashboards/a38de49b9b76fa6889f4e05886bb5afc913f5395/docs/onzack-velero-monitoring.png -------------------------------------------------------------------------------- /grafana/blackbox-exporter/prometheus-blackbox-exporter.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": { 7 | "type": "datasource", 8 | "uid": "grafana" 9 | }, 10 | "enable": true, 11 | "hide": true, 12 | "iconColor": "rgba(0, 211, 255, 1)", 13 | "name": "Annotations & Alerts", 14 | "target": { 15 | "limit": 100, 16 | "matchAny": false, 17 | "tags": [], 18 | "type": "dashboard" 19 | }, 20 | "type": "dashboard" 21 | } 22 | ] 23 | }, 24 | "description": "Prometheus Blackbox Exporter Overview", 25 | "editable": false, 26 | "fiscalYearStartMonth": 0, 27 | "gnetId": 7587, 28 | "graphTooltip": 0, 29 | "id": 14, 30 | "links": [], 31 | "liveNow": false, 32 | "panels": [ 33 | { 34 | "collapsed": false, 35 | "gridPos": { 36 | "h": 1, 37 | "w": 24, 38 | "x": 0, 39 | "y": 0 40 | }, 41 | "id": 172, 42 | "panels": [], 43 | "title": "Targets Overview", 44 | "type": "row" 45 | }, 46 | { 47 | "datasource": { 48 | "type": "prometheus", 49 | "uid": "${datasource}" 50 | }, 51 | "description": "", 52 | "fieldConfig": { 53 | "defaults": { 54 | "color": { 55 | "mode": "thresholds" 56 | }, 57 | "mappings": [], 58 | "thresholds": { 59 | "mode": "absolute", 60 | "steps": [ 61 | { 62 | "color": "green", 63 | "value": null 64 | }, 65 | { 66 | "color": "red", 67 | "value": 1 68 | } 69 | ] 70 | } 71 | }, 72 | "overrides": [] 73 | }, 74 | "gridPos": { 75 | "h": 6, 76 | "w": 6, 77 | "x": 0, 78 | "y": 1 79 | }, 80 | "id": 206, 81 | "options": { 82 | "colorMode": "value", 83 | "graphMode": "area", 84 | "justifyMode": "auto", 85 | "orientation": "horizontal", 86 | "reduceOptions": { 87 | "calcs": [], 88 | "fields": "", 89 | "values": false 90 | }, 91 | "textMode": "auto" 92 | }, 93 | "pluginVersion": "10.1.1", 94 | "targets": [ 95 | { 96 | "datasource": { 97 | "type": "prometheus", 98 | "uid": "${datasource}" 99 | }, 100 | "editorMode": "code", 101 | "expr": "count(probe_success{instance=~\"$target\"}==0)", 102 | "instant": false, 103 | "legendFormat": "__auto", 104 | "range": true, 105 | "refId": "A" 106 | } 107 | ], 108 | "title": "Down", 109 | "type": "stat" 110 | }, 111 | { 112 | "datasource": { 113 | "type": "prometheus", 114 | "uid": "${datasource}" 115 | }, 116 | "fieldConfig": { 117 | "defaults": { 118 | "color": { 119 | "mode": "thresholds" 120 | }, 121 | "mappings": [], 122 | "thresholds": { 123 | "mode": "absolute", 124 | "steps": [ 125 | { 126 | "color": "green", 127 | "value": null 128 | }, 129 | { 130 | "color": "red", 131 | "value": 1 132 | } 133 | ] 134 | } 135 | }, 136 | "overrides": [] 137 | }, 138 | "gridPos": { 139 | "h": 6, 140 | "w": 6, 141 | "x": 6, 142 | "y": 1 143 | }, 144 | "id": 237, 145 | "options": { 146 | "colorMode": "value", 147 | "graphMode": "area", 148 | "justifyMode": "auto", 149 | "orientation": "auto", 150 | "reduceOptions": { 151 | "calcs": [ 152 | "lastNotNull" 153 | ], 154 | "fields": "", 155 | "values": false 156 | }, 157 | "textMode": "auto" 158 | }, 159 | "pluginVersion": "10.1.1", 160 | "targets": [ 161 | { 162 | "datasource": { 163 | "type": "prometheus", 164 | "uid": "${datasource}" 165 | }, 166 | "editorMode": "code", 167 | "expr": "count(probe_http_status_code{instance=~\"$target\"}!=200 and probe_http_status_code{instance=~\"$target\"}!=0) OR on() vector(0)", 168 | "instant": false, 169 | "legendFormat": "__auto", 170 | "range": true, 171 | "refId": "A" 172 | } 173 | ], 174 | "title": "HTTP Status Error", 175 | "type": "stat" 176 | }, 177 | { 178 | "datasource": { 179 | "type": "prometheus", 180 | "uid": "${datasource}" 181 | }, 182 | "description": "", 183 | "fieldConfig": { 184 | "defaults": { 185 | "color": { 186 | "mode": "thresholds" 187 | }, 188 | "mappings": [], 189 | "thresholds": { 190 | "mode": "absolute", 191 | "steps": [ 192 | { 193 | "color": "green", 194 | "value": null 195 | }, 196 | { 197 | "color": "orange", 198 | "value": 1 199 | } 200 | ] 201 | } 202 | }, 203 | "overrides": [] 204 | }, 205 | "gridPos": { 206 | "h": 6, 207 | "w": 6, 208 | "x": 12, 209 | "y": 1 210 | }, 211 | "id": 238, 212 | "options": { 213 | "colorMode": "value", 214 | "graphMode": "area", 215 | "justifyMode": "auto", 216 | "orientation": "auto", 217 | "reduceOptions": { 218 | "calcs": [ 219 | "lastNotNull" 220 | ], 221 | "fields": "", 222 | "values": false 223 | }, 224 | "textMode": "auto" 225 | }, 226 | "pluginVersion": "10.1.1", 227 | "targets": [ 228 | { 229 | "datasource": { 230 | "type": "prometheus", 231 | "uid": "${datasource}" 232 | }, 233 | "editorMode": "code", 234 | "expr": "count(probe_http_ssl{instance=~\"$target\"}==0 and probe_success{instance=~\"$target\"}!=0) OR on() vector(0)", 235 | "instant": false, 236 | "legendFormat": "__auto", 237 | "range": true, 238 | "refId": "A" 239 | } 240 | ], 241 | "title": "No SSL", 242 | "type": "stat" 243 | }, 244 | { 245 | "datasource": { 246 | "type": "prometheus", 247 | "uid": "${datasource}" 248 | }, 249 | "fieldConfig": { 250 | "defaults": { 251 | "color": { 252 | "mode": "thresholds" 253 | }, 254 | "mappings": [], 255 | "thresholds": { 256 | "mode": "absolute", 257 | "steps": [ 258 | { 259 | "color": "green", 260 | "value": null 261 | }, 262 | { 263 | "color": "red", 264 | "value": 80 265 | } 266 | ] 267 | } 268 | }, 269 | "overrides": [] 270 | }, 271 | "gridPos": { 272 | "h": 6, 273 | "w": 6, 274 | "x": 18, 275 | "y": 1 276 | }, 277 | "id": 239, 278 | "options": { 279 | "colorMode": "value", 280 | "graphMode": "area", 281 | "justifyMode": "auto", 282 | "orientation": "auto", 283 | "reduceOptions": { 284 | "calcs": [ 285 | "lastNotNull" 286 | ], 287 | "fields": "", 288 | "values": false 289 | }, 290 | "textMode": "auto" 291 | }, 292 | "pluginVersion": "10.1.1", 293 | "targets": [ 294 | { 295 | "datasource": { 296 | "type": "prometheus", 297 | "uid": "${datasource}" 298 | }, 299 | "editorMode": "code", 300 | "expr": "count((probe_ssl_earliest_cert_expiry{instance=~\"$target\"}-time())<=0) OR on() vector(0)", 301 | "instant": false, 302 | "legendFormat": "__auto", 303 | "range": true, 304 | "refId": "A" 305 | } 306 | ], 307 | "title": "Expired SSL Cert", 308 | "type": "stat" 309 | }, 310 | { 311 | "datasource": { 312 | "type": "prometheus", 313 | "uid": "${datasource}" 314 | }, 315 | "fieldConfig": { 316 | "defaults": { 317 | "color": { 318 | "mode": "palette-classic" 319 | }, 320 | "custom": { 321 | "axisCenteredZero": false, 322 | "axisColorMode": "text", 323 | "axisLabel": "", 324 | "axisPlacement": "auto", 325 | "barAlignment": 0, 326 | "drawStyle": "line", 327 | "fillOpacity": 10, 328 | "gradientMode": "none", 329 | "hideFrom": { 330 | "legend": false, 331 | "tooltip": false, 332 | "viz": false 333 | }, 334 | "insertNulls": false, 335 | "lineInterpolation": "smooth", 336 | "lineWidth": 1, 337 | "pointSize": 5, 338 | "scaleDistribution": { 339 | "type": "linear" 340 | }, 341 | "showPoints": "never", 342 | "spanNulls": true, 343 | "stacking": { 344 | "group": "A", 345 | "mode": "none" 346 | }, 347 | "thresholdsStyle": { 348 | "mode": "off" 349 | } 350 | }, 351 | "mappings": [], 352 | "thresholds": { 353 | "mode": "absolute", 354 | "steps": [ 355 | { 356 | "color": "green", 357 | "value": null 358 | }, 359 | { 360 | "color": "red", 361 | "value": 80 362 | } 363 | ] 364 | }, 365 | "unit": "s" 366 | }, 367 | "overrides": [] 368 | }, 369 | "gridPos": { 370 | "h": 9, 371 | "w": 24, 372 | "x": 0, 373 | "y": 7 374 | }, 375 | "id": 138, 376 | "links": [], 377 | "options": { 378 | "legend": { 379 | "calcs": [], 380 | "displayMode": "table", 381 | "placement": "right", 382 | "showLegend": true 383 | }, 384 | "tooltip": { 385 | "mode": "multi", 386 | "sort": "asc" 387 | } 388 | }, 389 | "pluginVersion": "8.5.2", 390 | "targets": [ 391 | { 392 | "datasource": { 393 | "type": "prometheus", 394 | "uid": "${datasource}" 395 | }, 396 | "editorMode": "code", 397 | "exemplar": false, 398 | "expr": "probe_duration_seconds{instance=~\"$target\"}", 399 | "format": "time_series", 400 | "instant": false, 401 | "interval": "$interval", 402 | "intervalFactor": 1, 403 | "legendFormat": "{{ instance }}", 404 | "range": true, 405 | "refId": "A" 406 | } 407 | ], 408 | "title": "Global Probe Duration", 409 | "type": "timeseries" 410 | }, 411 | { 412 | "collapsed": false, 413 | "datasource": { 414 | "type": "prometheus", 415 | "uid": "${datasource}" 416 | }, 417 | "gridPos": { 418 | "h": 1, 419 | "w": 24, 420 | "x": 0, 421 | "y": 16 422 | }, 423 | "id": 15, 424 | "panels": [], 425 | "repeat": "target", 426 | "title": "$target status", 427 | "type": "row" 428 | }, 429 | { 430 | "datasource": { 431 | "type": "prometheus", 432 | "uid": "${datasource}" 433 | }, 434 | "fieldConfig": { 435 | "defaults": { 436 | "color": { 437 | "mode": "thresholds" 438 | }, 439 | "mappings": [ 440 | { 441 | "options": { 442 | "0": { 443 | "text": "DOWN" 444 | }, 445 | "1": { 446 | "text": "UP" 447 | } 448 | }, 449 | "type": "value" 450 | }, 451 | { 452 | "options": { 453 | "match": "null", 454 | "result": { 455 | "text": "N/A" 456 | } 457 | }, 458 | "type": "special" 459 | } 460 | ], 461 | "thresholds": { 462 | "mode": "absolute", 463 | "steps": [ 464 | { 465 | "color": "#d44a3a", 466 | "value": null 467 | }, 468 | { 469 | "color": "rgba(237, 129, 40, 0.89)", 470 | "value": 1 471 | }, 472 | { 473 | "color": "#299c46", 474 | "value": 1 475 | } 476 | ] 477 | }, 478 | "unit": "none" 479 | }, 480 | "overrides": [] 481 | }, 482 | "gridPos": { 483 | "h": 2, 484 | "w": 4, 485 | "x": 0, 486 | "y": 17 487 | }, 488 | "id": 2, 489 | "links": [], 490 | "maxDataPoints": 100, 491 | "options": { 492 | "colorMode": "background", 493 | "graphMode": "none", 494 | "justifyMode": "auto", 495 | "orientation": "horizontal", 496 | "reduceOptions": { 497 | "calcs": [ 498 | "lastNotNull" 499 | ], 500 | "fields": "", 501 | "values": false 502 | }, 503 | "textMode": "auto" 504 | }, 505 | "pluginVersion": "10.1.1", 506 | "repeatDirection": "v", 507 | "targets": [ 508 | { 509 | "expr": "probe_success{instance=~\"$target\"}", 510 | "format": "time_series", 511 | "interval": "$interval", 512 | "intervalFactor": 1, 513 | "refId": "A" 514 | } 515 | ], 516 | "title": "Status", 517 | "type": "stat" 518 | }, 519 | { 520 | "datasource": { 521 | "type": "prometheus", 522 | "uid": "${datasource}" 523 | }, 524 | "fieldConfig": { 525 | "defaults": { 526 | "color": { 527 | "mode": "palette-classic" 528 | }, 529 | "custom": { 530 | "axisCenteredZero": false, 531 | "axisColorMode": "text", 532 | "axisLabel": "", 533 | "axisPlacement": "auto", 534 | "barAlignment": 0, 535 | "drawStyle": "line", 536 | "fillOpacity": 10, 537 | "gradientMode": "none", 538 | "hideFrom": { 539 | "legend": false, 540 | "tooltip": false, 541 | "viz": false 542 | }, 543 | "insertNulls": false, 544 | "lineInterpolation": "smooth", 545 | "lineWidth": 1, 546 | "pointSize": 5, 547 | "scaleDistribution": { 548 | "type": "linear" 549 | }, 550 | "showPoints": "never", 551 | "spanNulls": true, 552 | "stacking": { 553 | "group": "A", 554 | "mode": "none" 555 | }, 556 | "thresholdsStyle": { 557 | "mode": "off" 558 | } 559 | }, 560 | "mappings": [], 561 | "thresholds": { 562 | "mode": "absolute", 563 | "steps": [ 564 | { 565 | "color": "green", 566 | "value": null 567 | }, 568 | { 569 | "color": "red", 570 | "value": 80 571 | } 572 | ] 573 | }, 574 | "unit": "s" 575 | }, 576 | "overrides": [] 577 | }, 578 | "gridPos": { 579 | "h": 6, 580 | "w": 10, 581 | "x": 4, 582 | "y": 17 583 | }, 584 | "id": 25, 585 | "links": [], 586 | "options": { 587 | "legend": { 588 | "calcs": [], 589 | "displayMode": "list", 590 | "placement": "bottom", 591 | "showLegend": true 592 | }, 593 | "tooltip": { 594 | "mode": "multi", 595 | "sort": "none" 596 | } 597 | }, 598 | "pluginVersion": "8.5.2", 599 | "targets": [ 600 | { 601 | "expr": "probe_http_duration_seconds{instance=~\"$target\"}", 602 | "format": "time_series", 603 | "interval": "$interval", 604 | "intervalFactor": 1, 605 | "legendFormat": "{{ phase }}", 606 | "refId": "B" 607 | } 608 | ], 609 | "title": "HTTP Duration", 610 | "type": "timeseries" 611 | }, 612 | { 613 | "datasource": { 614 | "type": "prometheus", 615 | "uid": "${datasource}" 616 | }, 617 | "fieldConfig": { 618 | "defaults": { 619 | "color": { 620 | "mode": "palette-classic" 621 | }, 622 | "custom": { 623 | "axisCenteredZero": false, 624 | "axisColorMode": "text", 625 | "axisLabel": "", 626 | "axisPlacement": "auto", 627 | "barAlignment": 0, 628 | "drawStyle": "line", 629 | "fillOpacity": 10, 630 | "gradientMode": "none", 631 | "hideFrom": { 632 | "legend": false, 633 | "tooltip": false, 634 | "viz": false 635 | }, 636 | "insertNulls": false, 637 | "lineInterpolation": "smooth", 638 | "lineWidth": 1, 639 | "pointSize": 5, 640 | "scaleDistribution": { 641 | "type": "linear" 642 | }, 643 | "showPoints": "never", 644 | "spanNulls": true, 645 | "stacking": { 646 | "group": "A", 647 | "mode": "none" 648 | }, 649 | "thresholdsStyle": { 650 | "mode": "off" 651 | } 652 | }, 653 | "mappings": [], 654 | "thresholds": { 655 | "mode": "absolute", 656 | "steps": [ 657 | { 658 | "color": "green", 659 | "value": null 660 | }, 661 | { 662 | "color": "red", 663 | "value": 80 664 | } 665 | ] 666 | }, 667 | "unit": "s" 668 | }, 669 | "overrides": [] 670 | }, 671 | "gridPos": { 672 | "h": 6, 673 | "w": 10, 674 | "x": 14, 675 | "y": 17 676 | }, 677 | "id": 17, 678 | "links": [], 679 | "options": { 680 | "legend": { 681 | "calcs": [], 682 | "displayMode": "list", 683 | "placement": "bottom", 684 | "showLegend": true 685 | }, 686 | "tooltip": { 687 | "mode": "multi", 688 | "sort": "none" 689 | } 690 | }, 691 | "pluginVersion": "8.5.2", 692 | "targets": [ 693 | { 694 | "expr": "probe_duration_seconds{instance=~\"$target\"}", 695 | "format": "time_series", 696 | "interval": "$interval", 697 | "intervalFactor": 1, 698 | "legendFormat": "seconds", 699 | "refId": "A" 700 | } 701 | ], 702 | "title": "Probe Duration", 703 | "type": "timeseries" 704 | }, 705 | { 706 | "datasource": { 707 | "type": "prometheus", 708 | "uid": "${datasource}" 709 | }, 710 | "fieldConfig": { 711 | "defaults": { 712 | "color": { 713 | "mode": "thresholds" 714 | }, 715 | "decimals": 0, 716 | "mappings": [ 717 | { 718 | "options": { 719 | "0": { 720 | "text": "N/A" 721 | }, 722 | "1": { 723 | "text": "YES" 724 | } 725 | }, 726 | "type": "value" 727 | }, 728 | { 729 | "options": { 730 | "match": "null", 731 | "result": { 732 | "text": "N/A" 733 | } 734 | }, 735 | "type": "special" 736 | } 737 | ], 738 | "thresholds": { 739 | "mode": "absolute", 740 | "steps": [ 741 | { 742 | "color": "#299c46", 743 | "value": null 744 | }, 745 | { 746 | "color": "rgba(237, 129, 40, 0.89)", 747 | "value": 201 748 | }, 749 | { 750 | "color": "#d44a3a", 751 | "value": 399 752 | } 753 | ] 754 | }, 755 | "unit": "none" 756 | }, 757 | "overrides": [] 758 | }, 759 | "gridPos": { 760 | "h": 2, 761 | "w": 4, 762 | "x": 0, 763 | "y": 19 764 | }, 765 | "id": 20, 766 | "links": [], 767 | "maxDataPoints": 100, 768 | "options": { 769 | "colorMode": "none", 770 | "graphMode": "none", 771 | "justifyMode": "auto", 772 | "orientation": "horizontal", 773 | "reduceOptions": { 774 | "calcs": [ 775 | "lastNotNull" 776 | ], 777 | "fields": "", 778 | "values": false 779 | }, 780 | "textMode": "auto" 781 | }, 782 | "pluginVersion": "10.1.1", 783 | "repeatDirection": "h", 784 | "targets": [ 785 | { 786 | "expr": "probe_http_status_code{instance=~\"$target\"}", 787 | "format": "time_series", 788 | "interval": "$interval", 789 | "intervalFactor": 1, 790 | "refId": "A" 791 | } 792 | ], 793 | "title": "HTTP Status Code", 794 | "type": "stat" 795 | }, 796 | { 797 | "datasource": { 798 | "type": "prometheus", 799 | "uid": "${datasource}" 800 | }, 801 | "fieldConfig": { 802 | "defaults": { 803 | "color": { 804 | "mode": "thresholds" 805 | }, 806 | "mappings": [ 807 | { 808 | "options": { 809 | "match": "null", 810 | "result": { 811 | "text": "N/A" 812 | } 813 | }, 814 | "type": "special" 815 | } 816 | ], 817 | "thresholds": { 818 | "mode": "absolute", 819 | "steps": [ 820 | { 821 | "color": "green", 822 | "value": null 823 | }, 824 | { 825 | "color": "red", 826 | "value": 80 827 | } 828 | ] 829 | }, 830 | "unit": "none" 831 | }, 832 | "overrides": [] 833 | }, 834 | "gridPos": { 835 | "h": 2, 836 | "w": 4, 837 | "x": 0, 838 | "y": 21 839 | }, 840 | "id": 27, 841 | "links": [], 842 | "maxDataPoints": 100, 843 | "options": { 844 | "colorMode": "none", 845 | "graphMode": "none", 846 | "justifyMode": "auto", 847 | "orientation": "horizontal", 848 | "reduceOptions": { 849 | "calcs": [ 850 | "lastNotNull" 851 | ], 852 | "fields": "", 853 | "values": false 854 | }, 855 | "textMode": "auto" 856 | }, 857 | "pluginVersion": "10.1.1", 858 | "targets": [ 859 | { 860 | "expr": "probe_http_version{instance=~\"$target\"}", 861 | "format": "time_series", 862 | "intervalFactor": 1, 863 | "refId": "A" 864 | } 865 | ], 866 | "title": "HTTP Version", 867 | "type": "stat" 868 | }, 869 | { 870 | "datasource": { 871 | "type": "prometheus", 872 | "uid": "${datasource}" 873 | }, 874 | "fieldConfig": { 875 | "defaults": { 876 | "color": { 877 | "mode": "thresholds" 878 | }, 879 | "mappings": [ 880 | { 881 | "options": { 882 | "0": { 883 | "text": "NO" 884 | }, 885 | "1": { 886 | "text": "YES" 887 | } 888 | }, 889 | "type": "value" 890 | }, 891 | { 892 | "options": { 893 | "match": "null", 894 | "result": { 895 | "text": "N/A" 896 | } 897 | }, 898 | "type": "special" 899 | } 900 | ], 901 | "thresholds": { 902 | "mode": "absolute", 903 | "steps": [ 904 | { 905 | "color": "#d44a3a", 906 | "value": null 907 | }, 908 | { 909 | "color": "rgba(237, 129, 40, 0.89)", 910 | "value": 0 911 | }, 912 | { 913 | "color": "#299c46", 914 | "value": 1 915 | } 916 | ] 917 | }, 918 | "unit": "none" 919 | }, 920 | "overrides": [] 921 | }, 922 | "gridPos": { 923 | "h": 2, 924 | "w": 4, 925 | "x": 0, 926 | "y": 23 927 | }, 928 | "id": 18, 929 | "links": [], 930 | "maxDataPoints": 100, 931 | "options": { 932 | "colorMode": "value", 933 | "graphMode": "none", 934 | "justifyMode": "auto", 935 | "orientation": "horizontal", 936 | "reduceOptions": { 937 | "calcs": [ 938 | "lastNotNull" 939 | ], 940 | "fields": "", 941 | "values": false 942 | }, 943 | "textMode": "auto" 944 | }, 945 | "pluginVersion": "10.1.1", 946 | "repeatDirection": "v", 947 | "targets": [ 948 | { 949 | "expr": "probe_http_ssl{instance=~\"$target\"}", 950 | "format": "time_series", 951 | "interval": "$interval", 952 | "intervalFactor": 1, 953 | "refId": "A" 954 | } 955 | ], 956 | "title": "SSL", 957 | "type": "stat" 958 | }, 959 | { 960 | "datasource": { 961 | "type": "prometheus", 962 | "uid": "${datasource}" 963 | }, 964 | "fieldConfig": { 965 | "defaults": { 966 | "color": { 967 | "mode": "thresholds" 968 | }, 969 | "decimals": 2, 970 | "mappings": [ 971 | { 972 | "options": { 973 | "0": { 974 | "text": "NO" 975 | }, 976 | "1": { 977 | "text": "YES" 978 | } 979 | }, 980 | "type": "value" 981 | }, 982 | { 983 | "options": { 984 | "match": "null", 985 | "result": { 986 | "text": "N/A" 987 | } 988 | }, 989 | "type": "special" 990 | } 991 | ], 992 | "thresholds": { 993 | "mode": "absolute", 994 | "steps": [ 995 | { 996 | "color": "#d44a3a", 997 | "value": null 998 | }, 999 | { 1000 | "color": "rgba(237, 129, 40, 0.89)", 1001 | "value": 0 1002 | }, 1003 | { 1004 | "color": "#299c46", 1005 | "value": 1209600 1006 | } 1007 | ] 1008 | }, 1009 | "unit": "dtdurations" 1010 | }, 1011 | "overrides": [] 1012 | }, 1013 | "gridPos": { 1014 | "h": 2, 1015 | "w": 10, 1016 | "x": 4, 1017 | "y": 23 1018 | }, 1019 | "id": 19, 1020 | "links": [], 1021 | "maxDataPoints": 100, 1022 | "options": { 1023 | "colorMode": "value", 1024 | "graphMode": "none", 1025 | "justifyMode": "auto", 1026 | "orientation": "horizontal", 1027 | "reduceOptions": { 1028 | "calcs": [ 1029 | "lastNotNull" 1030 | ], 1031 | "fields": "", 1032 | "values": false 1033 | }, 1034 | "textMode": "auto" 1035 | }, 1036 | "pluginVersion": "10.1.1", 1037 | "repeatDirection": "h", 1038 | "targets": [ 1039 | { 1040 | "expr": "probe_ssl_earliest_cert_expiry{instance=~\"$target\"} - time()", 1041 | "format": "time_series", 1042 | "interval": "$interval", 1043 | "intervalFactor": 1, 1044 | "refId": "A" 1045 | } 1046 | ], 1047 | "title": "SSL Expiry", 1048 | "type": "stat" 1049 | }, 1050 | { 1051 | "datasource": { 1052 | "type": "prometheus", 1053 | "uid": "${datasource}" 1054 | }, 1055 | "fieldConfig": { 1056 | "defaults": { 1057 | "color": { 1058 | "mode": "thresholds" 1059 | }, 1060 | "mappings": [ 1061 | { 1062 | "options": { 1063 | "match": "null", 1064 | "result": { 1065 | "text": "N/A" 1066 | } 1067 | }, 1068 | "type": "special" 1069 | } 1070 | ], 1071 | "thresholds": { 1072 | "mode": "absolute", 1073 | "steps": [ 1074 | { 1075 | "color": "green", 1076 | "value": null 1077 | }, 1078 | { 1079 | "color": "red", 1080 | "value": 80 1081 | } 1082 | ] 1083 | }, 1084 | "unit": "s" 1085 | }, 1086 | "overrides": [] 1087 | }, 1088 | "gridPos": { 1089 | "h": 2, 1090 | "w": 5, 1091 | "x": 14, 1092 | "y": 23 1093 | }, 1094 | "id": 23, 1095 | "links": [], 1096 | "maxDataPoints": 100, 1097 | "options": { 1098 | "colorMode": "none", 1099 | "graphMode": "none", 1100 | "justifyMode": "auto", 1101 | "orientation": "horizontal", 1102 | "reduceOptions": { 1103 | "calcs": [ 1104 | "lastNotNull" 1105 | ], 1106 | "fields": "", 1107 | "values": false 1108 | }, 1109 | "textMode": "auto" 1110 | }, 1111 | "pluginVersion": "10.1.1", 1112 | "targets": [ 1113 | { 1114 | "expr": "avg(probe_duration_seconds{instance=~\"$target\"})", 1115 | "format": "time_series", 1116 | "interval": "$interval", 1117 | "intervalFactor": 1, 1118 | "refId": "A" 1119 | } 1120 | ], 1121 | "title": "Average Probe Duration", 1122 | "type": "stat" 1123 | }, 1124 | { 1125 | "datasource": { 1126 | "type": "prometheus", 1127 | "uid": "${datasource}" 1128 | }, 1129 | "fieldConfig": { 1130 | "defaults": { 1131 | "color": { 1132 | "mode": "thresholds" 1133 | }, 1134 | "mappings": [ 1135 | { 1136 | "options": { 1137 | "match": "null", 1138 | "result": { 1139 | "text": "N/A" 1140 | } 1141 | }, 1142 | "type": "special" 1143 | } 1144 | ], 1145 | "thresholds": { 1146 | "mode": "absolute", 1147 | "steps": [ 1148 | { 1149 | "color": "green", 1150 | "value": null 1151 | }, 1152 | { 1153 | "color": "red", 1154 | "value": 80 1155 | } 1156 | ] 1157 | }, 1158 | "unit": "s" 1159 | }, 1160 | "overrides": [] 1161 | }, 1162 | "gridPos": { 1163 | "h": 2, 1164 | "w": 5, 1165 | "x": 19, 1166 | "y": 23 1167 | }, 1168 | "id": 24, 1169 | "links": [], 1170 | "maxDataPoints": 100, 1171 | "options": { 1172 | "colorMode": "none", 1173 | "graphMode": "none", 1174 | "justifyMode": "auto", 1175 | "orientation": "horizontal", 1176 | "reduceOptions": { 1177 | "calcs": [ 1178 | "lastNotNull" 1179 | ], 1180 | "fields": "", 1181 | "values": false 1182 | }, 1183 | "textMode": "auto" 1184 | }, 1185 | "pluginVersion": "10.1.1", 1186 | "repeatDirection": "h", 1187 | "targets": [ 1188 | { 1189 | "expr": "avg(probe_dns_lookup_time_seconds{instance=~\"$target\"})", 1190 | "format": "time_series", 1191 | "interval": "$interval", 1192 | "intervalFactor": 1, 1193 | "refId": "A" 1194 | } 1195 | ], 1196 | "title": "Average DNS Lookup", 1197 | "type": "stat" 1198 | } 1199 | ], 1200 | "refresh": "1m", 1201 | "schemaVersion": 38, 1202 | "style": "dark", 1203 | "tags": [ 1204 | "blackbox", 1205 | "prometheus" 1206 | ], 1207 | "templating": { 1208 | "list": [ 1209 | { 1210 | "current": { 1211 | "selected": false, 1212 | "text": "prometheus", 1213 | "value": "prometheus" 1214 | }, 1215 | "hide": 0, 1216 | "includeAll": false, 1217 | "label": "Datasource", 1218 | "multi": false, 1219 | "name": "datasource", 1220 | "options": [], 1221 | "query": "prometheus", 1222 | "queryValue": "", 1223 | "refresh": 1, 1224 | "regex": "", 1225 | "skipUrlSync": false, 1226 | "type": "datasource" 1227 | }, 1228 | { 1229 | "auto": true, 1230 | "auto_count": 10, 1231 | "auto_min": "10s", 1232 | "current": { 1233 | "selected": false, 1234 | "text": "10s", 1235 | "value": "10s" 1236 | }, 1237 | "hide": 0, 1238 | "label": "Interval", 1239 | "name": "interval", 1240 | "options": [ 1241 | { 1242 | "selected": false, 1243 | "text": "auto", 1244 | "value": "$__auto_interval_interval" 1245 | }, 1246 | { 1247 | "selected": false, 1248 | "text": "5s", 1249 | "value": "5s" 1250 | }, 1251 | { 1252 | "selected": true, 1253 | "text": "10s", 1254 | "value": "10s" 1255 | }, 1256 | { 1257 | "selected": false, 1258 | "text": "30s", 1259 | "value": "30s" 1260 | }, 1261 | { 1262 | "selected": false, 1263 | "text": "1m", 1264 | "value": "1m" 1265 | }, 1266 | { 1267 | "selected": false, 1268 | "text": "10m", 1269 | "value": "10m" 1270 | }, 1271 | { 1272 | "selected": false, 1273 | "text": "30m", 1274 | "value": "30m" 1275 | }, 1276 | { 1277 | "selected": false, 1278 | "text": "1h", 1279 | "value": "1h" 1280 | }, 1281 | { 1282 | "selected": false, 1283 | "text": "6h", 1284 | "value": "6h" 1285 | }, 1286 | { 1287 | "selected": false, 1288 | "text": "12h", 1289 | "value": "12h" 1290 | }, 1291 | { 1292 | "selected": false, 1293 | "text": "1d", 1294 | "value": "1d" 1295 | }, 1296 | { 1297 | "selected": false, 1298 | "text": "7d", 1299 | "value": "7d" 1300 | }, 1301 | { 1302 | "selected": false, 1303 | "text": "14d", 1304 | "value": "14d" 1305 | }, 1306 | { 1307 | "selected": false, 1308 | "text": "30d", 1309 | "value": "30d" 1310 | } 1311 | ], 1312 | "query": "5s,10s,30s,1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", 1313 | "refresh": 2, 1314 | "skipUrlSync": false, 1315 | "type": "interval" 1316 | }, 1317 | { 1318 | "current": { 1319 | "selected": true, 1320 | "text": [ 1321 | "All" 1322 | ], 1323 | "value": [ 1324 | "$__all" 1325 | ] 1326 | }, 1327 | "datasource": { 1328 | "type": "prometheus", 1329 | "uid": "${datasource}" 1330 | }, 1331 | "definition": "", 1332 | "hide": 0, 1333 | "includeAll": true, 1334 | "multi": true, 1335 | "name": "target", 1336 | "options": [], 1337 | "query": { 1338 | "query": "label_values(probe_success, instance)", 1339 | "refId": "prometheus-target-Variable-Query" 1340 | }, 1341 | "refresh": 1, 1342 | "regex": "", 1343 | "skipUrlSync": false, 1344 | "sort": 0, 1345 | "tagValuesQuery": "", 1346 | "tagsQuery": "", 1347 | "type": "query", 1348 | "useTags": false 1349 | } 1350 | ] 1351 | }, 1352 | "time": { 1353 | "from": "now-1h", 1354 | "to": "now" 1355 | }, 1356 | "timepicker": { 1357 | "refresh_intervals": [ 1358 | "5s", 1359 | "10s", 1360 | "30s", 1361 | "1m", 1362 | "5m", 1363 | "15m", 1364 | "30m", 1365 | "1h", 1366 | "2h", 1367 | "1d" 1368 | ], 1369 | "time_options": [ 1370 | "5m", 1371 | "15m", 1372 | "1h", 1373 | "6h", 1374 | "12h", 1375 | "24h", 1376 | "2d", 1377 | "7d", 1378 | "30d" 1379 | ] 1380 | }, 1381 | "timezone": "", 1382 | "title": "Prometheus Blackbox Exporter", 1383 | "uid": "ozk-pbe-mon", 1384 | "version": 1, 1385 | "weekStart": "" 1386 | } -------------------------------------------------------------------------------- /grafana/falco/onzack-falco-monitoring.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_LOKI", 5 | "label": "loki", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "loki", 9 | "pluginName": "Loki" 10 | } 11 | ], 12 | "__elements": {}, 13 | "__requires": [ 14 | { 15 | "type": "grafana", 16 | "id": "grafana", 17 | "name": "Grafana", 18 | "version": "11.2.0" 19 | }, 20 | { 21 | "type": "panel", 22 | "id": "logs", 23 | "name": "Logs", 24 | "version": "" 25 | }, 26 | { 27 | "type": "datasource", 28 | "id": "loki", 29 | "name": "Loki", 30 | "version": "1.0.0" 31 | }, 32 | { 33 | "type": "panel", 34 | "id": "piechart", 35 | "name": "Pie chart", 36 | "version": "" 37 | }, 38 | { 39 | "type": "datasource", 40 | "id": "prometheus", 41 | "name": "Prometheus", 42 | "version": "1.0.0" 43 | }, 44 | { 45 | "type": "panel", 46 | "id": "stat", 47 | "name": "Stat", 48 | "version": "" 49 | }, 50 | { 51 | "type": "panel", 52 | "id": "table", 53 | "name": "Table", 54 | "version": "" 55 | }, 56 | { 57 | "type": "panel", 58 | "id": "timeseries", 59 | "name": "Time series", 60 | "version": "" 61 | } 62 | ], 63 | "annotations": { 64 | "list": [ 65 | { 66 | "builtIn": 1, 67 | "datasource": { 68 | "type": "datasource", 69 | "uid": "grafana" 70 | }, 71 | "enable": true, 72 | "hide": true, 73 | "iconColor": "rgba(0, 211, 255, 1)", 74 | "name": "Annotations & Alerts", 75 | "target": { 76 | "limit": 100, 77 | "matchAny": false, 78 | "tags": [], 79 | "type": "dashboard" 80 | }, 81 | "type": "dashboard" 82 | } 83 | ] 84 | }, 85 | "description": "Grafana dashboard for Falco output events", 86 | "editable": true, 87 | "fiscalYearStartMonth": 0, 88 | "gnetId": 11914, 89 | "graphTooltip": 0, 90 | "id": null, 91 | "links": [], 92 | "liveNow": false, 93 | "panels": [ 94 | { 95 | "collapsed": false, 96 | "gridPos": { 97 | "h": 1, 98 | "w": 24, 99 | "x": 0, 100 | "y": 0 101 | }, 102 | "id": 18, 103 | "panels": [], 104 | "title": "Overview", 105 | "type": "row" 106 | }, 107 | { 108 | "datasource": { 109 | "type": "loki", 110 | "uid": "${datasource}" 111 | }, 112 | "fieldConfig": { 113 | "defaults": { 114 | "color": { 115 | "mode": "thresholds" 116 | }, 117 | "mappings": [], 118 | "thresholds": { 119 | "mode": "absolute", 120 | "steps": [ 121 | { 122 | "color": "green", 123 | "value": null 124 | } 125 | ] 126 | } 127 | }, 128 | "overrides": [] 129 | }, 130 | "gridPos": { 131 | "h": 9, 132 | "w": 4, 133 | "x": 0, 134 | "y": 1 135 | }, 136 | "id": 22, 137 | "options": { 138 | "colorMode": "value", 139 | "graphMode": "area", 140 | "justifyMode": "auto", 141 | "orientation": "auto", 142 | "percentChangeColorMode": "standard", 143 | "reduceOptions": { 144 | "calcs": [ 145 | "lastNotNull" 146 | ], 147 | "fields": "", 148 | "values": false 149 | }, 150 | "showPercentChange": false, 151 | "textMode": "auto", 152 | "wideLayout": true 153 | }, 154 | "pluginVersion": "11.2.0", 155 | "targets": [ 156 | { 157 | "datasource": { 158 | "type": "loki", 159 | "uid": "${DS_LOKI}" 160 | }, 161 | "editorMode": "code", 162 | "expr": "sum(count_over_time({$filter_falco_logs,priority=~\"$priority\"}[$__range]))", 163 | "hide": false, 164 | "queryType": "instant", 165 | "refId": "B" 166 | } 167 | ], 168 | "title": "Total Events", 169 | "type": "stat" 170 | }, 171 | { 172 | "datasource": { 173 | "type": "loki", 174 | "uid": "${datasource}" 175 | }, 176 | "description": "", 177 | "fieldConfig": { 178 | "defaults": { 179 | "color": { 180 | "mode": "palette-classic" 181 | }, 182 | "custom": { 183 | "hideFrom": { 184 | "legend": false, 185 | "tooltip": false, 186 | "viz": false 187 | } 188 | }, 189 | "mappings": [] 190 | }, 191 | "overrides": [] 192 | }, 193 | "gridPos": { 194 | "h": 9, 195 | "w": 6, 196 | "x": 4, 197 | "y": 1 198 | }, 199 | "id": 12, 200 | "options": { 201 | "displayLabels": [], 202 | "legend": { 203 | "displayMode": "table", 204 | "placement": "right", 205 | "showLegend": true, 206 | "values": [ 207 | "value" 208 | ] 209 | }, 210 | "pieType": "pie", 211 | "reduceOptions": { 212 | "calcs": [ 213 | "lastNotNull" 214 | ], 215 | "fields": "", 216 | "values": false 217 | }, 218 | "tooltip": { 219 | "mode": "single", 220 | "sort": "none" 221 | } 222 | }, 223 | "targets": [ 224 | { 225 | "datasource": { 226 | "type": "loki", 227 | "uid": "${DS_LOKI}" 228 | }, 229 | "editorMode": "code", 230 | "expr": "sum by (source) (count_over_time({$filter_falco_logs,priority=~\"$priority\"}[$__range]))", 231 | "hide": false, 232 | "legendFormat": "{{source}}", 233 | "queryType": "range", 234 | "refId": "B" 235 | } 236 | ], 237 | "title": "Sources", 238 | "type": "piechart" 239 | }, 240 | { 241 | "datasource": { 242 | "type": "loki", 243 | "uid": "${datasource}" 244 | }, 245 | "description": "", 246 | "fieldConfig": { 247 | "defaults": { 248 | "color": { 249 | "mode": "palette-classic" 250 | }, 251 | "custom": { 252 | "hideFrom": { 253 | "legend": false, 254 | "tooltip": false, 255 | "viz": false 256 | } 257 | }, 258 | "mappings": [] 259 | }, 260 | "overrides": [] 261 | }, 262 | "gridPos": { 263 | "h": 9, 264 | "w": 6, 265 | "x": 10, 266 | "y": 1 267 | }, 268 | "id": 9, 269 | "options": { 270 | "displayLabels": [], 271 | "legend": { 272 | "displayMode": "table", 273 | "placement": "right", 274 | "showLegend": true, 275 | "values": [ 276 | "value" 277 | ] 278 | }, 279 | "pieType": "pie", 280 | "reduceOptions": { 281 | "calcs": [ 282 | "lastNotNull" 283 | ], 284 | "fields": "", 285 | "values": false 286 | }, 287 | "tooltip": { 288 | "mode": "single", 289 | "sort": "none" 290 | } 291 | }, 292 | "targets": [ 293 | { 294 | "datasource": { 295 | "type": "loki", 296 | "uid": "${DS_LOKI}" 297 | }, 298 | "editorMode": "code", 299 | "expr": "sum by (priority) (count_over_time({$filter_falco_logs,priority=~\"$priority\"}[$__range]))", 300 | "hide": false, 301 | "legendFormat": "{{priority}}", 302 | "queryType": "range", 303 | "refId": "B" 304 | } 305 | ], 306 | "title": "Priorities", 307 | "type": "piechart" 308 | }, 309 | { 310 | "datasource": { 311 | "type": "loki", 312 | "uid": "${datasource}" 313 | }, 314 | "description": "", 315 | "fieldConfig": { 316 | "defaults": { 317 | "color": { 318 | "mode": "palette-classic" 319 | }, 320 | "custom": { 321 | "hideFrom": { 322 | "legend": false, 323 | "tooltip": false, 324 | "viz": false 325 | } 326 | }, 327 | "mappings": [] 328 | }, 329 | "overrides": [] 330 | }, 331 | "gridPos": { 332 | "h": 9, 333 | "w": 8, 334 | "x": 16, 335 | "y": 1 336 | }, 337 | "id": 13, 338 | "options": { 339 | "displayLabels": [], 340 | "legend": { 341 | "displayMode": "table", 342 | "placement": "right", 343 | "showLegend": true, 344 | "values": [ 345 | "value" 346 | ] 347 | }, 348 | "pieType": "pie", 349 | "reduceOptions": { 350 | "calcs": [ 351 | "lastNotNull" 352 | ], 353 | "fields": "", 354 | "values": false 355 | }, 356 | "tooltip": { 357 | "mode": "single", 358 | "sort": "none" 359 | } 360 | }, 361 | "pluginVersion": "8.5.3", 362 | "targets": [ 363 | { 364 | "datasource": { 365 | "type": "loki", 366 | "uid": "${DS_LOKI}" 367 | }, 368 | "editorMode": "code", 369 | "expr": "sum by (rule) (count_over_time({$filter_falco_logs,priority=~\"$priority\"}[$__range]))", 370 | "hide": false, 371 | "legendFormat": "{{rule}}", 372 | "queryType": "range", 373 | "refId": "B" 374 | } 375 | ], 376 | "title": "Rules", 377 | "type": "piechart" 378 | }, 379 | { 380 | "datasource": { 381 | "type": "loki", 382 | "uid": "${datasource}" 383 | }, 384 | "fieldConfig": { 385 | "defaults": { 386 | "color": { 387 | "mode": "palette-classic" 388 | }, 389 | "custom": { 390 | "axisBorderShow": false, 391 | "axisCenteredZero": false, 392 | "axisColorMode": "text", 393 | "axisLabel": "", 394 | "axisPlacement": "auto", 395 | "barAlignment": 0, 396 | "barWidthFactor": 0.6, 397 | "drawStyle": "bars", 398 | "fillOpacity": 10, 399 | "gradientMode": "none", 400 | "hideFrom": { 401 | "legend": false, 402 | "tooltip": false, 403 | "viz": false 404 | }, 405 | "insertNulls": false, 406 | "lineInterpolation": "linear", 407 | "lineStyle": { 408 | "fill": "solid" 409 | }, 410 | "lineWidth": 1, 411 | "pointSize": 5, 412 | "scaleDistribution": { 413 | "type": "linear" 414 | }, 415 | "showPoints": "auto", 416 | "spanNulls": false, 417 | "stacking": { 418 | "group": "A", 419 | "mode": "normal" 420 | }, 421 | "thresholdsStyle": { 422 | "mode": "off" 423 | } 424 | }, 425 | "mappings": [], 426 | "thresholds": { 427 | "mode": "absolute", 428 | "steps": [ 429 | { 430 | "color": "green", 431 | "value": null 432 | }, 433 | { 434 | "color": "red", 435 | "value": 80 436 | } 437 | ] 438 | } 439 | }, 440 | "overrides": [] 441 | }, 442 | "gridPos": { 443 | "h": 12, 444 | "w": 12, 445 | "x": 0, 446 | "y": 10 447 | }, 448 | "id": 14, 449 | "options": { 450 | "legend": { 451 | "calcs": [ 452 | "lastNotNull", 453 | "mean", 454 | "min", 455 | "max" 456 | ], 457 | "displayMode": "table", 458 | "placement": "right", 459 | "showLegend": true 460 | }, 461 | "tooltip": { 462 | "mode": "multi", 463 | "sort": "none" 464 | } 465 | }, 466 | "pluginVersion": "8.5.3", 467 | "targets": [ 468 | { 469 | "datasource": { 470 | "type": "loki", 471 | "uid": "${DS_LOKI}" 472 | }, 473 | "editorMode": "code", 474 | "expr": "sum by (priority) (count_over_time({$filter_falco_logs,priority=~\"$priority\"}[1m]))", 475 | "legendFormat": "{{priority}}", 476 | "queryType": "range", 477 | "refId": "A", 478 | "resolution": 1 479 | } 480 | ], 481 | "title": "Events rate", 482 | "type": "timeseries" 483 | }, 484 | { 485 | "datasource": { 486 | "default": false, 487 | "type": "loki", 488 | "uid": "${datasource}" 489 | }, 490 | "fieldConfig": { 491 | "defaults": { 492 | "color": { 493 | "mode": "thresholds" 494 | }, 495 | "custom": { 496 | "align": "auto", 497 | "cellOptions": { 498 | "type": "auto" 499 | }, 500 | "filterable": false, 501 | "inspect": false 502 | }, 503 | "mappings": [], 504 | "min": 0, 505 | "noValue": "No Rule Violations from Pods", 506 | "thresholds": { 507 | "mode": "absolute", 508 | "steps": [ 509 | { 510 | "color": "orange", 511 | "value": null 512 | } 513 | ] 514 | } 515 | }, 516 | "overrides": [ 517 | { 518 | "matcher": { 519 | "id": "byName", 520 | "options": "Rule Violations" 521 | }, 522 | "properties": [ 523 | { 524 | "id": "custom.cellOptions", 525 | "value": { 526 | "mode": "gradient", 527 | "type": "gauge" 528 | } 529 | } 530 | ] 531 | } 532 | ] 533 | }, 534 | "gridPos": { 535 | "h": 12, 536 | "w": 12, 537 | "x": 12, 538 | "y": 10 539 | }, 540 | "id": 16, 541 | "options": { 542 | "cellHeight": "sm", 543 | "footer": { 544 | "countRows": false, 545 | "fields": "", 546 | "reducer": [ 547 | "sum" 548 | ], 549 | "show": false 550 | }, 551 | "showHeader": true, 552 | "sortBy": [ 553 | { 554 | "desc": true, 555 | "displayName": "Rule Violations" 556 | } 557 | ] 558 | }, 559 | "pluginVersion": "11.2.0", 560 | "targets": [ 561 | { 562 | "datasource": { 563 | "type": "loki", 564 | "uid": "${DS_LOKI}" 565 | }, 566 | "editorMode": "code", 567 | "expr": "sum by (k8s_pod_name,k8s_ns) (\r\n count_over_time({$filter_falco_logs,priority=~\"$priority\",priority!=\"Debug\"} \r\n | logfmt | __error__ = \"\" \r\n | container!=\"host\", k8s_pod_name!=\")\" \r\n | label_format k8s_pod_name=`{{ .k8s_pod_name | replace \")\" \"\" }}`[$__range] # Replace \")\" in pod name with \"\"\r\n )\r\n)", 568 | "hide": false, 569 | "legendFormat": "", 570 | "queryType": "range", 571 | "refId": "B" 572 | } 573 | ], 574 | "title": "Top $top Pods", 575 | "transformations": [ 576 | { 577 | "id": "reduce", 578 | "options": { 579 | "labelsToFields": true, 580 | "reducers": [ 581 | "lastNotNull" 582 | ] 583 | } 584 | }, 585 | { 586 | "id": "sortBy", 587 | "options": { 588 | "fields": {}, 589 | "sort": [ 590 | { 591 | "desc": true, 592 | "field": "Last *" 593 | } 594 | ] 595 | } 596 | }, 597 | { 598 | "id": "limit", 599 | "options": { 600 | "limitField": "$top" 601 | } 602 | }, 603 | { 604 | "id": "organize", 605 | "options": { 606 | "excludeByName": { 607 | "Field": true, 608 | "Time": true 609 | }, 610 | "includeByName": {}, 611 | "indexByName": { 612 | "Time": 0, 613 | "Value #B": 3, 614 | "k8s_ns": 1, 615 | "k8s_pod_name": 2 616 | }, 617 | "renameByName": { 618 | "Last *": "Rule Violations", 619 | "Total": "Rule Violations", 620 | "Value #B": "Rule Violations", 621 | "k8s_ns": "Namespace", 622 | "k8s_pod": "Pod", 623 | "k8s_pod_name": "Pod" 624 | } 625 | } 626 | } 627 | ], 628 | "type": "table" 629 | }, 630 | { 631 | "collapsed": true, 632 | "gridPos": { 633 | "h": 1, 634 | "w": 24, 635 | "x": 0, 636 | "y": 22 637 | }, 638 | "id": 20, 639 | "panels": [ 640 | { 641 | "datasource": { 642 | "type": "loki", 643 | "uid": "${datasource}" 644 | }, 645 | "gridPos": { 646 | "h": 22, 647 | "w": 24, 648 | "x": 0, 649 | "y": 23 650 | }, 651 | "id": 11, 652 | "options": { 653 | "dedupStrategy": "none", 654 | "enableLogDetails": true, 655 | "prettifyLogMessage": false, 656 | "showCommonLabels": false, 657 | "showLabels": false, 658 | "showTime": false, 659 | "sortOrder": "Descending", 660 | "wrapLogMessage": false 661 | }, 662 | "pluginVersion": "8.5.3", 663 | "targets": [ 664 | { 665 | "datasource": { 666 | "type": "loki", 667 | "uid": "${DS_LOKI}" 668 | }, 669 | "expr": "{from=\"falcosidekick\",priority=~\"$priority\"} |~ \"(?i)$searchpattern\"\n| line_format `{{ if eq .priority \"Emergency\" }} ❌ {{ else if eq .priority \"Alert\" }} ❌ {{ else if eq .priority \"Critical\" }} ❌ {{ else if eq .priority \"Error\" }} 🔴 {{ else if eq .priority \"Warning\" }} 🟠 {{ else if eq .priority \"Notice\" }} 🟡 {{ else if eq .priority \"Informational\" }} 🔵 {{ else if eq .priority \"Debug\" }} 🟣 {{__line__}} {{else}} ⚪ {{end}} {{__line__}}`", 670 | "queryType": "range", 671 | "refId": "A" 672 | } 673 | ], 674 | "title": "Logs", 675 | "transformations": [], 676 | "type": "logs" 677 | } 678 | ], 679 | "title": "Logs", 680 | "type": "row" 681 | } 682 | ], 683 | "refresh": "", 684 | "schemaVersion": 39, 685 | "tags": [ 686 | "Security", 687 | "Runtime" 688 | ], 689 | "templating": { 690 | "list": [ 691 | { 692 | "current": {}, 693 | "hide": 0, 694 | "includeAll": false, 695 | "label": "Datasource", 696 | "multi": false, 697 | "name": "datasource", 698 | "options": [], 699 | "query": "loki", 700 | "queryValue": "", 701 | "refresh": 1, 702 | "regex": "", 703 | "skipUrlSync": false, 704 | "type": "datasource" 705 | }, 706 | { 707 | "current": { 708 | "selected": false, 709 | "text": "from=\"falcosidekick\"", 710 | "value": "from=\"falcosidekick\"" 711 | }, 712 | "description": "LogQL filter to get only Falco logs.", 713 | "hide": 2, 714 | "includeAll": false, 715 | "multi": false, 716 | "name": "filter_falco_logs", 717 | "options": [ 718 | { 719 | "selected": true, 720 | "text": "from=\"falcosidekick\"", 721 | "value": "from=\"falcosidekick\"" 722 | } 723 | ], 724 | "query": "from=\"falcosidekick\"", 725 | "skipUrlSync": false, 726 | "type": "custom" 727 | }, 728 | { 729 | "current": {}, 730 | "datasource": { 731 | "type": "loki", 732 | "uid": "${datasource}" 733 | }, 734 | "definition": "", 735 | "hide": 0, 736 | "includeAll": true, 737 | "label": "Priority", 738 | "multi": true, 739 | "name": "priority", 740 | "options": [], 741 | "query": { 742 | "label": "priority", 743 | "refId": "LokiVariableQueryEditor-VariableQuery", 744 | "stream": "{$filter_falco_logs}", 745 | "type": 1 746 | }, 747 | "refresh": 2, 748 | "regex": "", 749 | "skipUrlSync": false, 750 | "sort": 1, 751 | "type": "query" 752 | }, 753 | { 754 | "current": { 755 | "selected": false, 756 | "text": "10", 757 | "value": "10" 758 | }, 759 | "description": "this variable is only for the Top Panel!", 760 | "hide": 0, 761 | "includeAll": false, 762 | "label": "Top", 763 | "multi": false, 764 | "name": "top", 765 | "options": [ 766 | { 767 | "selected": false, 768 | "text": "5", 769 | "value": "5" 770 | }, 771 | { 772 | "selected": true, 773 | "text": "10", 774 | "value": "10" 775 | }, 776 | { 777 | "selected": false, 778 | "text": "20", 779 | "value": "20" 780 | }, 781 | { 782 | "selected": false, 783 | "text": "50", 784 | "value": "50" 785 | } 786 | ], 787 | "query": "5,10,20,50", 788 | "queryValue": "", 789 | "skipUrlSync": false, 790 | "type": "custom" 791 | }, 792 | { 793 | "current": { 794 | "selected": true, 795 | "text": "", 796 | "value": "" 797 | }, 798 | "description": "this variable is only for the Logs Panel!", 799 | "hide": 0, 800 | "label": "Search-Pattern", 801 | "name": "searchpattern", 802 | "options": [ 803 | { 804 | "selected": true, 805 | "text": "", 806 | "value": "" 807 | } 808 | ], 809 | "query": "", 810 | "skipUrlSync": false, 811 | "type": "textbox" 812 | } 813 | ] 814 | }, 815 | "time": { 816 | "from": "now-24h", 817 | "to": "now" 818 | }, 819 | "timepicker": {}, 820 | "timezone": "", 821 | "title": "Falco", 822 | "uid": "ozk-flc-mon", 823 | "version": 11, 824 | "weekStart": "" 825 | } -------------------------------------------------------------------------------- /grafana/gitlab-ci-pipelines-exporter/pipelines.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PROMETHEUS", 5 | "label": "prometheus", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "prometheus", 9 | "pluginName": "Prometheus" 10 | }, 11 | { 12 | "name": "VAR_GITLAB_HOST", 13 | "type": "constant", 14 | "label": "GITLAB_HOST", 15 | "value": "gitlab.onzack.io", 16 | "description": "" 17 | } 18 | ], 19 | "__elements": {}, 20 | "__requires": [ 21 | { 22 | "type": "grafana", 23 | "id": "grafana", 24 | "name": "Grafana", 25 | "version": "10.4.2" 26 | }, 27 | { 28 | "type": "datasource", 29 | "id": "prometheus", 30 | "name": "Prometheus", 31 | "version": "1.0.0" 32 | }, 33 | { 34 | "type": "panel", 35 | "id": "stat", 36 | "name": "Stat", 37 | "version": "" 38 | }, 39 | { 40 | "type": "panel", 41 | "id": "table", 42 | "name": "Table", 43 | "version": "" 44 | }, 45 | { 46 | "type": "panel", 47 | "id": "timeseries", 48 | "name": "Time series", 49 | "version": "" 50 | } 51 | ], 52 | "annotations": { 53 | "list": [ 54 | { 55 | "builtIn": 1, 56 | "datasource": { 57 | "type": "datasource", 58 | "uid": "grafana" 59 | }, 60 | "enable": true, 61 | "hide": true, 62 | "iconColor": "rgba(0, 211, 255, 1)", 63 | "name": "Annotations & Alerts", 64 | "target": { 65 | "limit": 100, 66 | "matchAny": false, 67 | "tags": [], 68 | "type": "dashboard" 69 | }, 70 | "type": "dashboard" 71 | } 72 | ] 73 | }, 74 | "description": "This dashboard leverages the Prometheus exporter I wrote to fetch information about GitLab CI pipelines statuses. More information here: https://github.com/mvisonneau/gitlab-ci-pipelines-exporter", 75 | "editable": false, 76 | "fiscalYearStartMonth": 0, 77 | "gnetId": 10620, 78 | "graphTooltip": 0, 79 | "id": null, 80 | "links": [], 81 | "liveNow": false, 82 | "panels": [ 83 | { 84 | "collapsed": true, 85 | "gridPos": { 86 | "h": 1, 87 | "w": 24, 88 | "x": 0, 89 | "y": 0 90 | }, 91 | "id": 124, 92 | "panels": [ 93 | { 94 | "datasource": { 95 | "type": "prometheus", 96 | "uid": "${DS_PROMETHEUS}" 97 | }, 98 | "fieldConfig": { 99 | "defaults": { 100 | "color": { 101 | "mode": "thresholds" 102 | }, 103 | "links": [ 104 | { 105 | "targetBlank": true, 106 | "title": "View project: ${__field.labels.project}", 107 | "url": "https://${GITLAB_HOST}/${__field.labels.project}/-/tree/${__field.labels.ref}" 108 | } 109 | ], 110 | "mappings": [ 111 | { 112 | "options": { 113 | "1": { 114 | "color": "green", 115 | "index": 0, 116 | "text": "SUCCESS" 117 | }, 118 | "2": { 119 | "color": "blue", 120 | "index": 1, 121 | "text": "RUNNING" 122 | }, 123 | "3": { 124 | "color": "red", 125 | "index": 2, 126 | "text": "FAILED/CANCELED" 127 | }, 128 | "4": { 129 | "color": "#808080", 130 | "index": 3, 131 | "text": "UNKNOWN" 132 | } 133 | }, 134 | "type": "value" 135 | }, 136 | { 137 | "options": { 138 | "match": "null", 139 | "result": { 140 | "color": "text", 141 | "index": 4, 142 | "text": "NO DATA" 143 | } 144 | }, 145 | "type": "special" 146 | } 147 | ], 148 | "thresholds": { 149 | "mode": "absolute", 150 | "steps": [ 151 | { 152 | "color": "green", 153 | "value": null 154 | } 155 | ] 156 | } 157 | }, 158 | "overrides": [] 159 | }, 160 | "gridPos": { 161 | "h": 8, 162 | "w": 24, 163 | "x": 0, 164 | "y": 1 165 | }, 166 | "id": 110, 167 | "options": { 168 | "colorMode": "background", 169 | "graphMode": "none", 170 | "justifyMode": "center", 171 | "orientation": "auto", 172 | "reduceOptions": { 173 | "calcs": [ 174 | "lastNotNull" 175 | ], 176 | "fields": "", 177 | "values": false 178 | }, 179 | "showPercentChange": false, 180 | "textMode": "none", 181 | "wideLayout": true 182 | }, 183 | "pluginVersion": "10.4.2", 184 | "targets": [ 185 | { 186 | "datasource": { 187 | "type": "prometheus", 188 | "uid": "${DS_PROMETHEUS}" 189 | }, 190 | "expr": "(gitlab_ci_pipeline_status{status=\"success\", project=~\"$PROJECT\", ref=~\"$REF\"} * 1 > 0) or (gitlab_ci_pipeline_status{status=\"running\", project=~\"$PROJECT\", ref=~\"$REF\"} * 2 > 0) or (gitlab_ci_pipeline_status{status=~\"failed|canceled\", project=~\"$PROJECT\", ref=~\"$REF\"} * 3 > 0) or (gitlab_ci_pipeline_status{status!~\"success|running|failed|canceled\", project=~\"$PROJECT\", ref=~\"$REF\"} * 4 > 0)", 191 | "format": "time_series", 192 | "hide": false, 193 | "instant": true, 194 | "interval": "", 195 | "intervalFactor": 1, 196 | "legendFormat": "{{project}} - {{ref}}", 197 | "refId": "A" 198 | } 199 | ], 200 | "transparent": true, 201 | "type": "stat" 202 | } 203 | ], 204 | "title": "Overview", 205 | "type": "row" 206 | }, 207 | { 208 | "collapsed": false, 209 | "gridPos": { 210 | "h": 1, 211 | "w": 24, 212 | "x": 0, 213 | "y": 1 214 | }, 215 | "id": 126, 216 | "panels": [], 217 | "title": "Details", 218 | "type": "row" 219 | }, 220 | { 221 | "datasource": { 222 | "type": "prometheus", 223 | "uid": "${DS_PROMETHEUS}" 224 | }, 225 | "fieldConfig": { 226 | "defaults": { 227 | "decimals": 0, 228 | "mappings": [ 229 | { 230 | "options": { 231 | "match": "null", 232 | "result": { 233 | "text": "N/A" 234 | } 235 | }, 236 | "type": "special" 237 | } 238 | ], 239 | "thresholds": { 240 | "mode": "absolute", 241 | "steps": [ 242 | { 243 | "color": "semi-dark-blue", 244 | "value": null 245 | }, 246 | { 247 | "color": "#d44a3a" 248 | } 249 | ] 250 | }, 251 | "unit": "none" 252 | }, 253 | "overrides": [] 254 | }, 255 | "gridPos": { 256 | "h": 3, 257 | "w": 2, 258 | "x": 0, 259 | "y": 2 260 | }, 261 | "id": 107, 262 | "maxDataPoints": 100, 263 | "options": { 264 | "colorMode": "background", 265 | "fieldOptions": { 266 | "calcs": [ 267 | "lastNotNull" 268 | ] 269 | }, 270 | "graphMode": "area", 271 | "justifyMode": "auto", 272 | "orientation": "horizontal", 273 | "reduceOptions": { 274 | "calcs": [ 275 | "last" 276 | ], 277 | "fields": "", 278 | "values": false 279 | }, 280 | "showPercentChange": false, 281 | "textMode": "auto", 282 | "wideLayout": true 283 | }, 284 | "pluginVersion": "10.4.2", 285 | "targets": [ 286 | { 287 | "datasource": { 288 | "type": "prometheus", 289 | "uid": "${DS_PROMETHEUS}" 290 | }, 291 | "expr": "count(gitlab_ci_pipeline_run_count{project=~\"$PROJECT\", ref=~\"$REF\"})", 292 | "format": "time_series", 293 | "instant": false, 294 | "interval": "", 295 | "intervalFactor": 1, 296 | "legendFormat": "", 297 | "refId": "A" 298 | } 299 | ], 300 | "title": "PIPELINES #", 301 | "type": "stat" 302 | }, 303 | { 304 | "datasource": { 305 | "type": "prometheus", 306 | "uid": "${DS_PROMETHEUS}" 307 | }, 308 | "fieldConfig": { 309 | "defaults": { 310 | "decimals": 0, 311 | "mappings": [ 312 | { 313 | "options": { 314 | "match": "null", 315 | "result": { 316 | "text": "N/A" 317 | } 318 | }, 319 | "type": "special" 320 | } 321 | ], 322 | "thresholds": { 323 | "mode": "absolute", 324 | "steps": [ 325 | { 326 | "color": "#299c46", 327 | "value": null 328 | }, 329 | { 330 | "color": "#C4162A", 331 | "value": 1 332 | }, 333 | { 334 | "color": "#d44a3a" 335 | } 336 | ] 337 | }, 338 | "unit": "none" 339 | }, 340 | "overrides": [] 341 | }, 342 | "gridPos": { 343 | "h": 3, 344 | "w": 2, 345 | "x": 2, 346 | "y": 2 347 | }, 348 | "id": 117, 349 | "maxDataPoints": 100, 350 | "options": { 351 | "colorMode": "background", 352 | "fieldOptions": { 353 | "calcs": [ 354 | "lastNotNull" 355 | ] 356 | }, 357 | "graphMode": "none", 358 | "justifyMode": "auto", 359 | "orientation": "horizontal", 360 | "reduceOptions": { 361 | "calcs": [ 362 | "last" 363 | ], 364 | "fields": "", 365 | "values": false 366 | }, 367 | "showPercentChange": false, 368 | "textMode": "auto", 369 | "wideLayout": true 370 | }, 371 | "pluginVersion": "10.4.2", 372 | "targets": [ 373 | { 374 | "datasource": { 375 | "type": "prometheus", 376 | "uid": "${DS_PROMETHEUS}" 377 | }, 378 | "expr": "count(gitlab_ci_pipeline_status{status=\"failed\", project=~\"$PROJECT\", ref=~\"$REF\"} > 0) or vector(0)", 379 | "format": "time_series", 380 | "instant": false, 381 | "interval": "", 382 | "intervalFactor": 1, 383 | "legendFormat": "", 384 | "refId": "A" 385 | } 386 | ], 387 | "title": "FAILED PIPELINES #", 388 | "type": "stat" 389 | }, 390 | { 391 | "datasource": { 392 | "type": "prometheus", 393 | "uid": "${DS_PROMETHEUS}" 394 | }, 395 | "fieldConfig": { 396 | "defaults": { 397 | "decimals": 0, 398 | "mappings": [ 399 | { 400 | "options": { 401 | "match": "null", 402 | "result": { 403 | "text": "N/A" 404 | } 405 | }, 406 | "type": "special" 407 | } 408 | ], 409 | "thresholds": { 410 | "mode": "absolute", 411 | "steps": [ 412 | { 413 | "color": "semi-dark-blue", 414 | "value": null 415 | }, 416 | { 417 | "color": "#d44a3a" 418 | } 419 | ] 420 | }, 421 | "unit": "none" 422 | }, 423 | "overrides": [] 424 | }, 425 | "gridPos": { 426 | "h": 3, 427 | "w": 5, 428 | "x": 4, 429 | "y": 2 430 | }, 431 | "id": 118, 432 | "maxDataPoints": 100, 433 | "options": { 434 | "colorMode": "background", 435 | "fieldOptions": { 436 | "calcs": [ 437 | "lastNotNull" 438 | ] 439 | }, 440 | "graphMode": "area", 441 | "justifyMode": "auto", 442 | "orientation": "horizontal", 443 | "reduceOptions": { 444 | "calcs": [ 445 | "last" 446 | ], 447 | "fields": "", 448 | "values": false 449 | }, 450 | "showPercentChange": false, 451 | "textMode": "auto", 452 | "wideLayout": true 453 | }, 454 | "pluginVersion": "10.4.2", 455 | "targets": [ 456 | { 457 | "datasource": { 458 | "type": "prometheus", 459 | "uid": "${DS_PROMETHEUS}" 460 | }, 461 | "expr": "sum(increase(gitlab_ci_pipeline_run_count{project=~\"$PROJECT\", ref=~\"$REF\"}[1h]))", 462 | "format": "time_series", 463 | "instant": false, 464 | "interval": "", 465 | "intervalFactor": 1, 466 | "legendFormat": "", 467 | "refId": "A" 468 | } 469 | ], 470 | "title": "RUNS # (in the last hour)", 471 | "type": "stat" 472 | }, 473 | { 474 | "datasource": { 475 | "type": "prometheus", 476 | "uid": "${DS_PROMETHEUS}" 477 | }, 478 | "description": "", 479 | "fieldConfig": { 480 | "defaults": { 481 | "color": { 482 | "mode": "palette-classic" 483 | }, 484 | "custom": { 485 | "axisBorderShow": false, 486 | "axisCenteredZero": false, 487 | "axisColorMode": "text", 488 | "axisGridShow": true, 489 | "axisLabel": "", 490 | "axisPlacement": "auto", 491 | "barAlignment": 0, 492 | "drawStyle": "bars", 493 | "fillOpacity": 100, 494 | "gradientMode": "none", 495 | "hideFrom": { 496 | "legend": false, 497 | "tooltip": false, 498 | "viz": false 499 | }, 500 | "insertNulls": false, 501 | "lineInterpolation": "stepBefore", 502 | "lineWidth": 1, 503 | "pointSize": 5, 504 | "scaleDistribution": { 505 | "type": "linear" 506 | }, 507 | "showPoints": "auto", 508 | "spanNulls": false, 509 | "stacking": { 510 | "group": "A", 511 | "mode": "normal" 512 | }, 513 | "thresholdsStyle": { 514 | "mode": "off" 515 | } 516 | }, 517 | "mappings": [], 518 | "min": 0, 519 | "noValue": "no pipeline runs in selected time range", 520 | "thresholds": { 521 | "mode": "absolute", 522 | "steps": [ 523 | { 524 | "color": "green", 525 | "value": null 526 | }, 527 | { 528 | "color": "red", 529 | "value": 80 530 | } 531 | ] 532 | }, 533 | "unit": "short" 534 | }, 535 | "overrides": [] 536 | }, 537 | "gridPos": { 538 | "h": 6, 539 | "w": 15, 540 | "x": 9, 541 | "y": 2 542 | }, 543 | "id": 114, 544 | "options": { 545 | "legend": { 546 | "calcs": [], 547 | "displayMode": "table", 548 | "placement": "right", 549 | "showLegend": false 550 | }, 551 | "tooltip": { 552 | "mode": "single", 553 | "sort": "none" 554 | } 555 | }, 556 | "pluginVersion": "9.2.1", 557 | "targets": [ 558 | { 559 | "datasource": { 560 | "type": "prometheus", 561 | "uid": "${DS_PROMETHEUS}" 562 | }, 563 | "editorMode": "code", 564 | "expr": "sum(increase(gitlab_ci_pipeline_run_count{project=~\"$PROJECT\", ref=~\"$REF\"}[5m])) by (project, ref) / sum(increase(gitlab_ci_pipeline_run_count{project=~\"$PROJECT\", ref=~\"$REF\"}[5m])) by (project, ref) > 0", 565 | "format": "time_series", 566 | "instant": false, 567 | "interval": "", 568 | "legendFormat": "{{ project }} - {{ ref }}", 569 | "refId": "A" 570 | } 571 | ], 572 | "title": "PIPELINE RUNS", 573 | "type": "timeseries" 574 | }, 575 | { 576 | "datasource": { 577 | "type": "prometheus", 578 | "uid": "${DS_PROMETHEUS}" 579 | }, 580 | "fieldConfig": { 581 | "defaults": { 582 | "decimals": 0, 583 | "mappings": [ 584 | { 585 | "options": { 586 | "match": "null", 587 | "result": { 588 | "text": "N/A" 589 | } 590 | }, 591 | "type": "special" 592 | } 593 | ], 594 | "thresholds": { 595 | "mode": "absolute", 596 | "steps": [ 597 | { 598 | "color": "#299c46", 599 | "value": null 600 | }, 601 | { 602 | "color": "rgba(237, 129, 40, 0.89)", 603 | "value": 5184000 604 | }, 605 | { 606 | "color": "#C4162A", 607 | "value": 15552000 608 | } 609 | ] 610 | }, 611 | "unit": "dtdurations" 612 | }, 613 | "overrides": [] 614 | }, 615 | "gridPos": { 616 | "h": 3, 617 | "w": 5, 618 | "x": 0, 619 | "y": 5 620 | }, 621 | "id": 108, 622 | "maxDataPoints": 100, 623 | "options": { 624 | "colorMode": "background", 625 | "fieldOptions": { 626 | "calcs": [ 627 | "lastNotNull" 628 | ] 629 | }, 630 | "graphMode": "area", 631 | "justifyMode": "center", 632 | "orientation": "horizontal", 633 | "reduceOptions": { 634 | "calcs": [ 635 | "lastNotNull" 636 | ], 637 | "fields": "/^avg_pipeline_frequency$/", 638 | "values": false 639 | }, 640 | "showPercentChange": false, 641 | "textMode": "auto", 642 | "wideLayout": true 643 | }, 644 | "pluginVersion": "10.4.2", 645 | "targets": [ 646 | { 647 | "datasource": { 648 | "type": "prometheus", 649 | "uid": "${DS_PROMETHEUS}" 650 | }, 651 | "editorMode": "code", 652 | "expr": "avg(time() - gitlab_ci_pipeline_timestamp{project=~\"$PROJECT\", ref=~\"$REF\"})", 653 | "format": "time_series", 654 | "interval": "", 655 | "intervalFactor": 1, 656 | "legendFormat": "avg_pipeline_frequency", 657 | "range": true, 658 | "refId": "A" 659 | } 660 | ], 661 | "title": "Average Pipeline Run Frequency", 662 | "type": "stat" 663 | }, 664 | { 665 | "datasource": { 666 | "type": "prometheus", 667 | "uid": "${DS_PROMETHEUS}" 668 | }, 669 | "fieldConfig": { 670 | "defaults": { 671 | "decimals": 0, 672 | "mappings": [ 673 | { 674 | "options": { 675 | "match": "null", 676 | "result": { 677 | "text": "N/A" 678 | } 679 | }, 680 | "type": "special" 681 | } 682 | ], 683 | "thresholds": { 684 | "mode": "absolute", 685 | "steps": [ 686 | { 687 | "color": "#299c46", 688 | "value": null 689 | }, 690 | { 691 | "color": "rgba(237, 129, 40, 0.89)", 692 | "value": 600 693 | }, 694 | { 695 | "color": "#d44a3a", 696 | "value": 900 697 | } 698 | ] 699 | }, 700 | "unit": "dtdurations" 701 | }, 702 | "overrides": [] 703 | }, 704 | "gridPos": { 705 | "h": 3, 706 | "w": 4, 707 | "x": 5, 708 | "y": 5 709 | }, 710 | "id": 106, 711 | "maxDataPoints": 100, 712 | "options": { 713 | "colorMode": "background", 714 | "fieldOptions": { 715 | "calcs": [ 716 | "lastNotNull" 717 | ] 718 | }, 719 | "graphMode": "area", 720 | "justifyMode": "auto", 721 | "orientation": "horizontal", 722 | "reduceOptions": { 723 | "calcs": [ 724 | "lastNotNull" 725 | ], 726 | "fields": "", 727 | "values": false 728 | }, 729 | "showPercentChange": false, 730 | "textMode": "auto", 731 | "wideLayout": true 732 | }, 733 | "pluginVersion": "10.4.2", 734 | "targets": [ 735 | { 736 | "datasource": { 737 | "type": "prometheus", 738 | "uid": "${DS_PROMETHEUS}" 739 | }, 740 | "expr": "avg(gitlab_ci_pipeline_duration_seconds{project=~\"$PROJECT\", ref=~\"$REF\"})", 741 | "format": "time_series", 742 | "interval": "", 743 | "intervalFactor": 1, 744 | "legendFormat": "", 745 | "refId": "A" 746 | } 747 | ], 748 | "title": "Average Pipeline Duration", 749 | "type": "stat" 750 | }, 751 | { 752 | "datasource": { 753 | "type": "prometheus", 754 | "uid": "${DS_PROMETHEUS}" 755 | }, 756 | "fieldConfig": { 757 | "defaults": { 758 | "color": { 759 | "mode": "thresholds" 760 | }, 761 | "custom": { 762 | "align": "center", 763 | "cellOptions": { 764 | "type": "auto" 765 | }, 766 | "filterable": false, 767 | "inspect": false 768 | }, 769 | "links": [], 770 | "mappings": [], 771 | "thresholds": { 772 | "mode": "absolute", 773 | "steps": [ 774 | { 775 | "color": "green", 776 | "value": null 777 | } 778 | ] 779 | } 780 | }, 781 | "overrides": [ 782 | { 783 | "matcher": { 784 | "id": "byName", 785 | "options": "ID" 786 | }, 787 | "properties": [ 788 | { 789 | "id": "links", 790 | "value": [ 791 | { 792 | "targetBlank": true, 793 | "title": "View pipeline #${__value.numeric}", 794 | "url": "https://${GITLAB_HOST}/${__data.fields.project}/pipelines/${__value.numeric}" 795 | } 796 | ] 797 | }, 798 | { 799 | "id": "custom.cellOptions", 800 | "value": { 801 | "mode": "gradient", 802 | "type": "color-background" 803 | } 804 | }, 805 | { 806 | "id": "color", 807 | "value": { 808 | "fixedColor": "dark-blue", 809 | "mode": "fixed" 810 | } 811 | }, 812 | { 813 | "id": "custom.width", 814 | "value": 85 815 | } 816 | ] 817 | }, 818 | { 819 | "matcher": { 820 | "id": "byName", 821 | "options": "Status" 822 | }, 823 | "properties": [ 824 | { 825 | "id": "custom.cellOptions", 826 | "value": { 827 | "mode": "gradient", 828 | "type": "color-background" 829 | } 830 | }, 831 | { 832 | "id": "color", 833 | "value": { 834 | "mode": "thresholds" 835 | } 836 | }, 837 | { 838 | "id": "mappings", 839 | "value": [ 840 | { 841 | "options": { 842 | "2": { 843 | "text": "RUNNING" 844 | }, 845 | "3": { 846 | "text": "FAILED" 847 | }, 848 | "4": { 849 | "text": "CANCELED" 850 | }, 851 | "5": { 852 | "text": "CREATED" 853 | }, 854 | "6": { 855 | "text": "WAITING FOR RESOURCE" 856 | }, 857 | "7": { 858 | "text": "PREPARING" 859 | }, 860 | "8": { 861 | "text": "PENDING" 862 | }, 863 | "9": { 864 | "text": "SKIPPED" 865 | }, 866 | "10": { 867 | "text": "MANUAL" 868 | }, 869 | "11": { 870 | "text": "SCHEDULED" 871 | } 872 | }, 873 | "type": "value" 874 | } 875 | ] 876 | }, 877 | { 878 | "id": "thresholds", 879 | "value": { 880 | "mode": "absolute", 881 | "steps": [ 882 | { 883 | "color": "green", 884 | "value": null 885 | }, 886 | { 887 | "color": "light-blue", 888 | "value": 1 889 | }, 890 | { 891 | "color": "semi-dark-red", 892 | "value": 3 893 | }, 894 | { 895 | "color": "light-orange", 896 | "value": 5 897 | }, 898 | { 899 | "color": "rgb(135, 135, 134)", 900 | "value": 9 901 | } 902 | ] 903 | } 904 | } 905 | ] 906 | }, 907 | { 908 | "matcher": { 909 | "id": "byName", 910 | "options": "Job" 911 | }, 912 | "properties": [ 913 | { 914 | "id": "custom.align", 915 | "value": "left" 916 | }, 917 | { 918 | "id": "custom.width", 919 | "value": 230 920 | } 921 | ] 922 | }, 923 | { 924 | "matcher": { 925 | "id": "byName", 926 | "options": "Project" 927 | }, 928 | "properties": [ 929 | { 930 | "id": "custom.align", 931 | "value": "left" 932 | }, 933 | { 934 | "id": "custom.width", 935 | "value": 218 936 | } 937 | ] 938 | }, 939 | { 940 | "matcher": { 941 | "id": "byName", 942 | "options": "Ref Kind" 943 | }, 944 | "properties": [ 945 | { 946 | "id": "custom.width", 947 | "value": 98 948 | } 949 | ] 950 | }, 951 | { 952 | "matcher": { 953 | "id": "byName", 954 | "options": "Ref Name" 955 | }, 956 | "properties": [ 957 | { 958 | "id": "custom.width", 959 | "value": 122 960 | } 961 | ] 962 | }, 963 | { 964 | "matcher": { 965 | "id": "byName", 966 | "options": "Duration" 967 | }, 968 | "properties": [ 969 | { 970 | "id": "unit", 971 | "value": "dtdurations" 972 | }, 973 | { 974 | "id": "thresholds", 975 | "value": { 976 | "mode": "absolute", 977 | "steps": [ 978 | { 979 | "color": "green", 980 | "value": null 981 | }, 982 | { 983 | "color": "light-orange", 984 | "value": 900 985 | }, 986 | { 987 | "color": "semi-dark-red", 988 | "value": 1200 989 | } 990 | ] 991 | } 992 | }, 993 | { 994 | "id": "custom.cellOptions", 995 | "value": { 996 | "mode": "gradient", 997 | "type": "color-background" 998 | } 999 | } 1000 | ] 1001 | }, 1002 | { 1003 | "matcher": { 1004 | "id": "byName", 1005 | "options": "Date" 1006 | }, 1007 | "properties": [ 1008 | { 1009 | "id": "unit", 1010 | "value": "dtdurations" 1011 | }, 1012 | { 1013 | "id": "custom.cellOptions", 1014 | "value": { 1015 | "mode": "gradient", 1016 | "type": "color-background" 1017 | } 1018 | } 1019 | ] 1020 | } 1021 | ] 1022 | }, 1023 | "gridPos": { 1024 | "h": 22, 1025 | "w": 12, 1026 | "x": 0, 1027 | "y": 8 1028 | }, 1029 | "id": 120, 1030 | "options": { 1031 | "cellHeight": "sm", 1032 | "footer": { 1033 | "countRows": false, 1034 | "fields": "", 1035 | "reducer": [ 1036 | "sum" 1037 | ], 1038 | "show": false 1039 | }, 1040 | "showHeader": true, 1041 | "sortBy": [ 1042 | { 1043 | "desc": true, 1044 | "displayName": "Date" 1045 | } 1046 | ] 1047 | }, 1048 | "pluginVersion": "10.4.2", 1049 | "targets": [ 1050 | { 1051 | "datasource": { 1052 | "type": "prometheus", 1053 | "uid": "${DS_PROMETHEUS}" 1054 | }, 1055 | "expr": "-max(time() - gitlab_ci_pipeline_timestamp{project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) unless max(gitlab_ci_pipeline_status{status=~\"success\", project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) > 0", 1056 | "format": "table", 1057 | "hide": false, 1058 | "instant": true, 1059 | "interval": "", 1060 | "intervalFactor": 1, 1061 | "legendFormat": "", 1062 | "refId": "B" 1063 | }, 1064 | { 1065 | "datasource": { 1066 | "type": "prometheus", 1067 | "uid": "${DS_PROMETHEUS}" 1068 | }, 1069 | "expr": "max(gitlab_ci_pipeline_duration_seconds{project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) unless (max(gitlab_ci_pipeline_status{status=~\"success\", project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) > 0)", 1070 | "format": "table", 1071 | "hide": false, 1072 | "instant": true, 1073 | "interval": "", 1074 | "intervalFactor": 1, 1075 | "legendFormat": "", 1076 | "refId": "C" 1077 | }, 1078 | { 1079 | "datasource": { 1080 | "type": "prometheus", 1081 | "uid": "${DS_PROMETHEUS}" 1082 | }, 1083 | "expr": "(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"running\"}) by (project, ref, kind) * 2) > 0 or\n(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"failed\"}) by (project, ref, kind) * 3) > 0 or\n(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"canceled\"}) by (project, ref, kind) * 4) > 0 or\n(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"created\"}) by (project, ref, kind) * 5) > 0 or\n(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"waiting_for_resource\"}) by (project, ref, kind) * 6) > 0 or\n(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"preparing\"}) by (project, ref, kind) * 7) > 0 or\n(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"pending\"}) by (project, ref, kind) * 8) > 0 or\n(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"skipped\"}) by (project, ref, kind) * 9) > 0 or\n(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"manual\"}) by (project, ref, kind) * 10) > 0 or\n(max(gitlab_ci_pipeline_status{project=~\"$PROJECT\", ref=~\"$REF\", status=~\"scheduled\"}) by (project, ref, kind) * 11) > 0", 1084 | "format": "table", 1085 | "hide": false, 1086 | "instant": true, 1087 | "interval": "", 1088 | "intervalFactor": 1, 1089 | "legendFormat": "", 1090 | "refId": "A" 1091 | }, 1092 | { 1093 | "datasource": { 1094 | "type": "prometheus", 1095 | "uid": "${DS_PROMETHEUS}" 1096 | }, 1097 | "expr": "max(gitlab_ci_pipeline_id{project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind, job_name) unless (max(gitlab_ci_pipeline_status{status=~\"success\", project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind, job_name) > 0)", 1098 | "format": "table", 1099 | "instant": true, 1100 | "interval": "", 1101 | "legendFormat": "", 1102 | "refId": "D" 1103 | } 1104 | ], 1105 | "title": "RUNNING, FAILED OR NOT COMPLETED", 1106 | "transformations": [ 1107 | { 1108 | "id": "merge", 1109 | "options": {} 1110 | }, 1111 | { 1112 | "id": "organize", 1113 | "options": { 1114 | "excludeByName": { 1115 | "Time": true, 1116 | "Value #A": false, 1117 | "job_name": false 1118 | }, 1119 | "indexByName": { 1120 | "Time": 0, 1121 | "Value #A": 9, 1122 | "Value #B": 6, 1123 | "Value #C": 7, 1124 | "Value #D": 1, 1125 | "job_name": 3, 1126 | "kind": 4, 1127 | "project": 2, 1128 | "ref": 5, 1129 | "status": 8 1130 | }, 1131 | "renameByName": { 1132 | "Value #A": "Status", 1133 | "Value #B": "Date", 1134 | "Value #C": "Duration", 1135 | "Value #D": "ID", 1136 | "job_name": "Job", 1137 | "kind": "Ref Kind", 1138 | "project": "Project", 1139 | "ref": "Ref Name", 1140 | "status": "Status" 1141 | } 1142 | } 1143 | } 1144 | ], 1145 | "type": "table" 1146 | }, 1147 | { 1148 | "datasource": { 1149 | "type": "prometheus", 1150 | "uid": "${DS_PROMETHEUS}" 1151 | }, 1152 | "fieldConfig": { 1153 | "defaults": { 1154 | "color": { 1155 | "mode": "thresholds" 1156 | }, 1157 | "custom": { 1158 | "align": "center", 1159 | "cellOptions": { 1160 | "type": "auto" 1161 | }, 1162 | "filterable": false, 1163 | "inspect": false 1164 | }, 1165 | "links": [], 1166 | "mappings": [], 1167 | "thresholds": { 1168 | "mode": "absolute", 1169 | "steps": [ 1170 | { 1171 | "color": "green", 1172 | "value": null 1173 | } 1174 | ] 1175 | } 1176 | }, 1177 | "overrides": [ 1178 | { 1179 | "matcher": { 1180 | "id": "byName", 1181 | "options": "ID" 1182 | }, 1183 | "properties": [ 1184 | { 1185 | "id": "links", 1186 | "value": [ 1187 | { 1188 | "targetBlank": true, 1189 | "title": "View pipeline #${__value.numeric}", 1190 | "url": "https://${GITLAB_HOST}/${__data.fields.project}/pipelines/${__value.numeric}" 1191 | } 1192 | ] 1193 | }, 1194 | { 1195 | "id": "custom.cellOptions", 1196 | "value": { 1197 | "mode": "gradient", 1198 | "type": "color-background" 1199 | } 1200 | }, 1201 | { 1202 | "id": "color", 1203 | "value": { 1204 | "fixedColor": "dark-blue", 1205 | "mode": "fixed" 1206 | } 1207 | }, 1208 | { 1209 | "id": "custom.width", 1210 | "value": 85 1211 | } 1212 | ] 1213 | }, 1214 | { 1215 | "matcher": { 1216 | "id": "byName", 1217 | "options": "Status" 1218 | }, 1219 | "properties": [ 1220 | { 1221 | "id": "custom.cellOptions", 1222 | "value": { 1223 | "mode": "gradient", 1224 | "type": "color-background" 1225 | } 1226 | }, 1227 | { 1228 | "id": "mappings", 1229 | "value": [ 1230 | { 1231 | "options": { 1232 | "1": { 1233 | "text": "SUCCESS" 1234 | } 1235 | }, 1236 | "type": "value" 1237 | } 1238 | ] 1239 | } 1240 | ] 1241 | }, 1242 | { 1243 | "matcher": { 1244 | "id": "byName", 1245 | "options": "Job" 1246 | }, 1247 | "properties": [ 1248 | { 1249 | "id": "custom.align", 1250 | "value": "left" 1251 | }, 1252 | { 1253 | "id": "custom.width", 1254 | "value": 230 1255 | } 1256 | ] 1257 | }, 1258 | { 1259 | "matcher": { 1260 | "id": "byName", 1261 | "options": "Project" 1262 | }, 1263 | "properties": [ 1264 | { 1265 | "id": "custom.align", 1266 | "value": "left" 1267 | }, 1268 | { 1269 | "id": "custom.width", 1270 | "value": 218 1271 | } 1272 | ] 1273 | }, 1274 | { 1275 | "matcher": { 1276 | "id": "byName", 1277 | "options": "Ref Kind" 1278 | }, 1279 | "properties": [ 1280 | { 1281 | "id": "custom.width", 1282 | "value": 98 1283 | } 1284 | ] 1285 | }, 1286 | { 1287 | "matcher": { 1288 | "id": "byName", 1289 | "options": "Ref Name" 1290 | }, 1291 | "properties": [ 1292 | { 1293 | "id": "custom.width", 1294 | "value": 122 1295 | } 1296 | ] 1297 | }, 1298 | { 1299 | "matcher": { 1300 | "id": "byName", 1301 | "options": "Duration" 1302 | }, 1303 | "properties": [ 1304 | { 1305 | "id": "unit", 1306 | "value": "dtdurations" 1307 | }, 1308 | { 1309 | "id": "thresholds", 1310 | "value": { 1311 | "mode": "absolute", 1312 | "steps": [ 1313 | { 1314 | "color": "green", 1315 | "value": null 1316 | }, 1317 | { 1318 | "color": "light-orange", 1319 | "value": 900 1320 | }, 1321 | { 1322 | "color": "semi-dark-red", 1323 | "value": 1200 1324 | } 1325 | ] 1326 | } 1327 | }, 1328 | { 1329 | "id": "custom.cellOptions", 1330 | "value": { 1331 | "mode": "gradient", 1332 | "type": "color-background" 1333 | } 1334 | } 1335 | ] 1336 | }, 1337 | { 1338 | "matcher": { 1339 | "id": "byName", 1340 | "options": "Date" 1341 | }, 1342 | "properties": [ 1343 | { 1344 | "id": "unit", 1345 | "value": "dtdurations" 1346 | }, 1347 | { 1348 | "id": "custom.cellOptions", 1349 | "value": { 1350 | "mode": "gradient", 1351 | "type": "color-background" 1352 | } 1353 | } 1354 | ] 1355 | } 1356 | ] 1357 | }, 1358 | "gridPos": { 1359 | "h": 22, 1360 | "w": 12, 1361 | "x": 12, 1362 | "y": 8 1363 | }, 1364 | "id": 122, 1365 | "options": { 1366 | "cellHeight": "sm", 1367 | "footer": { 1368 | "countRows": false, 1369 | "fields": "", 1370 | "reducer": [ 1371 | "sum" 1372 | ], 1373 | "show": false 1374 | }, 1375 | "showHeader": true, 1376 | "sortBy": [ 1377 | { 1378 | "desc": true, 1379 | "displayName": "Date" 1380 | } 1381 | ] 1382 | }, 1383 | "pluginVersion": "10.4.2", 1384 | "targets": [ 1385 | { 1386 | "datasource": { 1387 | "type": "prometheus", 1388 | "uid": "${DS_PROMETHEUS}" 1389 | }, 1390 | "expr": "-max(time() - gitlab_ci_pipeline_timestamp{project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) unless max(gitlab_ci_pipeline_status{status!~\"success\", project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) > 0", 1391 | "format": "table", 1392 | "hide": false, 1393 | "instant": true, 1394 | "interval": "", 1395 | "intervalFactor": 1, 1396 | "legendFormat": "", 1397 | "refId": "B" 1398 | }, 1399 | { 1400 | "datasource": { 1401 | "type": "prometheus", 1402 | "uid": "${DS_PROMETHEUS}" 1403 | }, 1404 | "expr": "max(gitlab_ci_pipeline_duration_seconds{project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) unless (max(gitlab_ci_pipeline_status{status!~\"success\", project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) > 0)", 1405 | "format": "table", 1406 | "hide": false, 1407 | "instant": true, 1408 | "interval": "", 1409 | "intervalFactor": 1, 1410 | "legendFormat": "", 1411 | "refId": "C" 1412 | }, 1413 | { 1414 | "datasource": { 1415 | "type": "prometheus", 1416 | "uid": "${DS_PROMETHEUS}" 1417 | }, 1418 | "expr": "max(gitlab_ci_pipeline_id{project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) unless (max(gitlab_ci_pipeline_status{status!~\"success\", project=~\"$PROJECT\", ref=~\"$REF\"}) by (project, ref, kind) > 0)", 1419 | "format": "table", 1420 | "instant": true, 1421 | "interval": "", 1422 | "legendFormat": "", 1423 | "refId": "D" 1424 | } 1425 | ], 1426 | "title": "SUCCESSFULLY COMPLETED", 1427 | "transformations": [ 1428 | { 1429 | "id": "merge", 1430 | "options": {} 1431 | }, 1432 | { 1433 | "id": "organize", 1434 | "options": { 1435 | "excludeByName": { 1436 | "Time": true, 1437 | "Value #A": false, 1438 | "job_name": false 1439 | }, 1440 | "indexByName": { 1441 | "Time": 0, 1442 | "Value #A": 9, 1443 | "Value #B": 6, 1444 | "Value #C": 7, 1445 | "Value #D": 1, 1446 | "job_name": 3, 1447 | "kind": 4, 1448 | "project": 2, 1449 | "ref": 5, 1450 | "status": 8 1451 | }, 1452 | "renameByName": { 1453 | "Value #A": "Status", 1454 | "Value #B": "Date", 1455 | "Value #C": "Duration", 1456 | "Value #D": "ID", 1457 | "job_name": "Job", 1458 | "kind": "Ref Kind", 1459 | "project": "Project", 1460 | "ref": "Ref Name", 1461 | "status": "Status" 1462 | } 1463 | } 1464 | }, 1465 | { 1466 | "id": "calculateField", 1467 | "options": { 1468 | "alias": "Status", 1469 | "mode": "reduceRow", 1470 | "reduce": { 1471 | "include": [ 1472 | "ID" 1473 | ], 1474 | "reducer": "count" 1475 | } 1476 | } 1477 | } 1478 | ], 1479 | "type": "table" 1480 | } 1481 | ], 1482 | "refresh": "5m", 1483 | "schemaVersion": 39, 1484 | "tags": [ 1485 | "GitLab" 1486 | ], 1487 | "templating": { 1488 | "list": [ 1489 | { 1490 | "current": { 1491 | "selected": false, 1492 | "text": "prometheus", 1493 | "value": "prometheus" 1494 | }, 1495 | "hide": 0, 1496 | "includeAll": false, 1497 | "label": "Datasource", 1498 | "multi": false, 1499 | "name": "datasource", 1500 | "options": [], 1501 | "query": "prometheus", 1502 | "refresh": 1, 1503 | "regex": "", 1504 | "skipUrlSync": false, 1505 | "type": "datasource" 1506 | }, 1507 | { 1508 | "hide": 2, 1509 | "name": "GITLAB_HOST", 1510 | "query": "${VAR_GITLAB_HOST}", 1511 | "skipUrlSync": false, 1512 | "type": "constant", 1513 | "current": { 1514 | "value": "${VAR_GITLAB_HOST}", 1515 | "text": "${VAR_GITLAB_HOST}", 1516 | "selected": false 1517 | }, 1518 | "options": [ 1519 | { 1520 | "value": "${VAR_GITLAB_HOST}", 1521 | "text": "${VAR_GITLAB_HOST}", 1522 | "selected": false 1523 | } 1524 | ] 1525 | }, 1526 | { 1527 | "allValue": ".*", 1528 | "current": {}, 1529 | "datasource": { 1530 | "type": "prometheus", 1531 | "uid": "${DS_PROMETHEUS}" 1532 | }, 1533 | "definition": "label_values(gitlab_ci_pipeline_id, project)", 1534 | "hide": 0, 1535 | "includeAll": true, 1536 | "label": "owner", 1537 | "multi": true, 1538 | "name": "OWNER", 1539 | "options": [], 1540 | "query": { 1541 | "query": "label_values(gitlab_ci_pipeline_id, project)", 1542 | "refId": "prometheus-OWNER-Variable-Query" 1543 | }, 1544 | "refresh": 2, 1545 | "regex": "/(.*)\\/.*$/", 1546 | "skipUrlSync": false, 1547 | "sort": 0, 1548 | "tagValuesQuery": "", 1549 | "tagsQuery": "", 1550 | "type": "query", 1551 | "useTags": false 1552 | }, 1553 | { 1554 | "allValue": ".*", 1555 | "current": {}, 1556 | "datasource": { 1557 | "type": "prometheus", 1558 | "uid": "${DS_PROMETHEUS}" 1559 | }, 1560 | "definition": "label_values(gitlab_ci_pipeline_id{project=~\"$OWNER.*\"}, project)", 1561 | "hide": 0, 1562 | "includeAll": true, 1563 | "label": "project", 1564 | "multi": true, 1565 | "name": "PROJECT", 1566 | "options": [], 1567 | "query": { 1568 | "query": "label_values(gitlab_ci_pipeline_id{project=~\"$OWNER.*\"}, project)", 1569 | "refId": "prometheus-PROJECT-Variable-Query" 1570 | }, 1571 | "refresh": 2, 1572 | "regex": "", 1573 | "skipUrlSync": false, 1574 | "sort": 1, 1575 | "tagValuesQuery": "", 1576 | "tagsQuery": "", 1577 | "type": "query", 1578 | "useTags": false 1579 | }, 1580 | { 1581 | "allValue": ".*", 1582 | "current": {}, 1583 | "datasource": { 1584 | "type": "prometheus", 1585 | "uid": "${DS_PROMETHEUS}" 1586 | }, 1587 | "definition": "label_values(gitlab_ci_pipeline_id{project=~\"$PROJECT\"}, ref)", 1588 | "hide": 0, 1589 | "includeAll": true, 1590 | "label": "ref", 1591 | "multi": true, 1592 | "name": "REF", 1593 | "options": [], 1594 | "query": { 1595 | "query": "label_values(gitlab_ci_pipeline_id{project=~\"$PROJECT\"}, ref)", 1596 | "refId": "prometheus-REF-Variable-Query" 1597 | }, 1598 | "refresh": 2, 1599 | "regex": "", 1600 | "skipUrlSync": false, 1601 | "sort": 1, 1602 | "tagValuesQuery": "", 1603 | "tagsQuery": "", 1604 | "type": "query", 1605 | "useTags": false 1606 | } 1607 | ] 1608 | }, 1609 | "time": { 1610 | "from": "now-1h", 1611 | "to": "now" 1612 | }, 1613 | "timepicker": { 1614 | "refresh_intervals": [ 1615 | "10s", 1616 | "30s", 1617 | "1m", 1618 | "5m", 1619 | "15m", 1620 | "30m", 1621 | "1h", 1622 | "2h", 1623 | "1d" 1624 | ], 1625 | "time_options": [ 1626 | "5m", 1627 | "15m", 1628 | "1h", 1629 | "6h", 1630 | "12h", 1631 | "24h", 1632 | "2d", 1633 | "7d", 1634 | "30d" 1635 | ] 1636 | }, 1637 | "timezone": "", 1638 | "title": "GitLab CI Pipelines", 1639 | "uid": "gitlab_ci_pipelines", 1640 | "version": 10, 1641 | "weekStart": "" 1642 | } -------------------------------------------------------------------------------- /grafana/systemd/onzack-systemd-monitoring.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_PROMETHEUS", 5 | "label": "prometheus", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "prometheus", 9 | "pluginName": "Prometheus" 10 | } 11 | ], 12 | "__elements": {}, 13 | "__requires": [ 14 | { 15 | "type": "grafana", 16 | "id": "grafana", 17 | "name": "Grafana", 18 | "version": "10.1.4" 19 | }, 20 | { 21 | "type": "datasource", 22 | "id": "prometheus", 23 | "name": "Prometheus", 24 | "version": "1.0.0" 25 | }, 26 | { 27 | "type": "panel", 28 | "id": "stat", 29 | "name": "Stat", 30 | "version": "" 31 | }, 32 | { 33 | "type": "panel", 34 | "id": "table", 35 | "name": "Table", 36 | "version": "" 37 | }, 38 | { 39 | "type": "panel", 40 | "id": "timeseries", 41 | "name": "Time series", 42 | "version": "" 43 | } 44 | ], 45 | "annotations": { 46 | "list": [ 47 | { 48 | "builtIn": 1, 49 | "datasource": { 50 | "type": "grafana", 51 | "uid": "-- Grafana --" 52 | }, 53 | "enable": true, 54 | "hide": true, 55 | "iconColor": "rgba(0, 211, 255, 1)", 56 | "name": "Annotations & Alerts", 57 | "type": "dashboard" 58 | } 59 | ] 60 | }, 61 | "description": "Show stats from node_exporter systemd collector.", 62 | "editable": true, 63 | "fiscalYearStartMonth": 0, 64 | "gnetId": 1617, 65 | "graphTooltip": 0, 66 | "id": null, 67 | "links": [], 68 | "liveNow": false, 69 | "panels": [ 70 | { 71 | "datasource": { 72 | "type": "prometheus", 73 | "uid": "${DS_PROMETHEUS}" 74 | }, 75 | "fieldConfig": { 76 | "defaults": { 77 | "color": { 78 | "mode": "thresholds" 79 | }, 80 | "mappings": [], 81 | "thresholds": { 82 | "mode": "absolute", 83 | "steps": [ 84 | { 85 | "color": "green", 86 | "value": null 87 | }, 88 | { 89 | "color": "red", 90 | "value": 1 91 | } 92 | ] 93 | } 94 | }, 95 | "overrides": [] 96 | }, 97 | "gridPos": { 98 | "h": 7, 99 | "w": 3, 100 | "x": 0, 101 | "y": 0 102 | }, 103 | "id": 19, 104 | "options": { 105 | "colorMode": "value", 106 | "graphMode": "area", 107 | "justifyMode": "auto", 108 | "orientation": "auto", 109 | "reduceOptions": { 110 | "calcs": [ 111 | "lastNotNull" 112 | ], 113 | "fields": "", 114 | "values": false 115 | }, 116 | "textMode": "auto" 117 | }, 118 | "pluginVersion": "10.1.4", 119 | "targets": [ 120 | { 121 | "datasource": { 122 | "type": "prometheus", 123 | "uid": "${DS_PROMETHEUS}" 124 | }, 125 | "editorMode": "code", 126 | "expr": "sum(node_systemd_unit_state{state=\"failed\"})", 127 | "instant": false, 128 | "legendFormat": "__auto", 129 | "range": true, 130 | "refId": "A" 131 | } 132 | ], 133 | "title": "Failed", 134 | "type": "stat" 135 | }, 136 | { 137 | "datasource": { 138 | "type": "prometheus", 139 | "uid": "${DS_PROMETHEUS}" 140 | }, 141 | "fieldConfig": { 142 | "defaults": { 143 | "color": { 144 | "mode": "palette-classic" 145 | }, 146 | "custom": { 147 | "axisCenteredZero": false, 148 | "axisColorMode": "text", 149 | "axisLabel": "", 150 | "axisPlacement": "auto", 151 | "barAlignment": 0, 152 | "drawStyle": "line", 153 | "fillOpacity": 10, 154 | "gradientMode": "none", 155 | "hideFrom": { 156 | "legend": false, 157 | "tooltip": false, 158 | "viz": false 159 | }, 160 | "insertNulls": false, 161 | "lineInterpolation": "linear", 162 | "lineWidth": 1, 163 | "pointSize": 5, 164 | "scaleDistribution": { 165 | "type": "linear" 166 | }, 167 | "showPoints": "never", 168 | "spanNulls": false, 169 | "stacking": { 170 | "group": "A", 171 | "mode": "none" 172 | }, 173 | "thresholdsStyle": { 174 | "mode": "off" 175 | } 176 | }, 177 | "decimals": 0, 178 | "mappings": [], 179 | "thresholds": { 180 | "mode": "absolute", 181 | "steps": [ 182 | { 183 | "color": "green", 184 | "value": null 185 | }, 186 | { 187 | "color": "red", 188 | "value": 80 189 | } 190 | ] 191 | }, 192 | "unit": "short" 193 | }, 194 | "overrides": [] 195 | }, 196 | "gridPos": { 197 | "h": 7, 198 | "w": 21, 199 | "x": 3, 200 | "y": 0 201 | }, 202 | "id": 7, 203 | "links": [], 204 | "options": { 205 | "legend": { 206 | "calcs": [], 207 | "displayMode": "table", 208 | "placement": "right", 209 | "showLegend": true 210 | }, 211 | "tooltip": { 212 | "mode": "multi", 213 | "sort": "none" 214 | } 215 | }, 216 | "pluginVersion": "10.1.4", 217 | "targets": [ 218 | { 219 | "datasource": { 220 | "type": "prometheus", 221 | "uid": "${DS_PROMETHEUS}" 222 | }, 223 | "editorMode": "code", 224 | "expr": "sum by (node, name, state) (node_systemd_unit_state{state=\"failed\"} * on(instance) group_left(node) label_replace(node_uname_info, \"node\", \"$1\", \"nodename\", \"(.*)\")) > 0", 225 | "format": "time_series", 226 | "interval": "", 227 | "intervalFactor": 2, 228 | "legendFormat": "{{name}}, node {{node}", 229 | "metric": "node_systemd_unit_state", 230 | "range": true, 231 | "refId": "A", 232 | "step": 20 233 | } 234 | ], 235 | "timeFrom": "24h", 236 | "title": "Failed (all nodes)", 237 | "type": "timeseries" 238 | }, 239 | { 240 | "datasource": { 241 | "type": "prometheus", 242 | "uid": "${DS_PROMETHEUS}" 243 | }, 244 | "fieldConfig": { 245 | "defaults": { 246 | "color": { 247 | "mode": "palette-classic" 248 | }, 249 | "custom": { 250 | "axisCenteredZero": false, 251 | "axisColorMode": "text", 252 | "axisLabel": "", 253 | "axisPlacement": "auto", 254 | "barAlignment": 0, 255 | "drawStyle": "line", 256 | "fillOpacity": 10, 257 | "gradientMode": "none", 258 | "hideFrom": { 259 | "legend": false, 260 | "tooltip": false, 261 | "viz": false 262 | }, 263 | "insertNulls": false, 264 | "lineInterpolation": "linear", 265 | "lineWidth": 1, 266 | "pointSize": 5, 267 | "scaleDistribution": { 268 | "type": "linear" 269 | }, 270 | "showPoints": "never", 271 | "spanNulls": false, 272 | "stacking": { 273 | "group": "A", 274 | "mode": "none" 275 | }, 276 | "thresholdsStyle": { 277 | "mode": "off" 278 | } 279 | }, 280 | "decimals": 0, 281 | "mappings": [], 282 | "thresholds": { 283 | "mode": "absolute", 284 | "steps": [ 285 | { 286 | "color": "green", 287 | "value": null 288 | }, 289 | { 290 | "color": "red", 291 | "value": 80 292 | } 293 | ] 294 | }, 295 | "unit": "short" 296 | }, 297 | "overrides": [] 298 | }, 299 | "gridPos": { 300 | "h": 7, 301 | "w": 24, 302 | "x": 0, 303 | "y": 7 304 | }, 305 | "id": 15, 306 | "links": [], 307 | "options": { 308 | "legend": { 309 | "calcs": [], 310 | "displayMode": "table", 311 | "placement": "right", 312 | "showLegend": true 313 | }, 314 | "tooltip": { 315 | "mode": "multi", 316 | "sort": "none" 317 | } 318 | }, 319 | "pluginVersion": "10.1.4", 320 | "targets": [ 321 | { 322 | "datasource": { 323 | "type": "prometheus", 324 | "uid": "${DS_PROMETHEUS}" 325 | }, 326 | "editorMode": "code", 327 | "expr": "sum by (node, name, state) (node_systemd_unit_state{state=\"inactive\"} * on(instance) group_left(node) label_replace(node_uname_info, \"node\", \"$1\", \"nodename\", \"(.*)\")) > 0", 328 | "format": "time_series", 329 | "interval": "", 330 | "intervalFactor": 2, 331 | "legendFormat": "{{name}}, node {{node}}", 332 | "metric": "node_systemd_unit_state", 333 | "range": true, 334 | "refId": "A", 335 | "step": 20 336 | } 337 | ], 338 | "timeFrom": "24h", 339 | "title": "Inactive (all nodes)", 340 | "type": "timeseries" 341 | }, 342 | { 343 | "datasource": { 344 | "type": "prometheus", 345 | "uid": "${DS_PROMETHEUS}" 346 | }, 347 | "fieldConfig": { 348 | "defaults": { 349 | "color": { 350 | "mode": "thresholds" 351 | }, 352 | "custom": { 353 | "align": "auto", 354 | "cellOptions": { 355 | "type": "auto" 356 | }, 357 | "inspect": false 358 | }, 359 | "mappings": [], 360 | "thresholds": { 361 | "mode": "absolute", 362 | "steps": [ 363 | { 364 | "color": "green", 365 | "value": null 366 | }, 367 | { 368 | "color": "red", 369 | "value": 1 370 | } 371 | ] 372 | } 373 | }, 374 | "overrides": [ 375 | { 376 | "matcher": { 377 | "id": "byName", 378 | "options": "Failed" 379 | }, 380 | "properties": [ 381 | { 382 | "id": "custom.cellOptions", 383 | "value": { 384 | "type": "color-background" 385 | } 386 | } 387 | ] 388 | } 389 | ] 390 | }, 391 | "gridPos": { 392 | "h": 7, 393 | "w": 24, 394 | "x": 0, 395 | "y": 14 396 | }, 397 | "id": 18, 398 | "options": { 399 | "cellHeight": "sm", 400 | "footer": { 401 | "countRows": false, 402 | "fields": "", 403 | "reducer": [ 404 | "sum" 405 | ], 406 | "show": false 407 | }, 408 | "showHeader": true 409 | }, 410 | "pluginVersion": "10.1.4", 411 | "targets": [ 412 | { 413 | "datasource": { 414 | "type": "prometheus", 415 | "uid": "${DS_PROMETHEUS}" 416 | }, 417 | "editorMode": "code", 418 | "exemplar": false, 419 | "expr": "sum by(node, state) (node_systemd_unit_state * on(instance, pod) group_left(node) label_replace(node_uname_info, \"node\", \"$1\", \"nodename\", \"(.*)\"))", 420 | "format": "table", 421 | "instant": true, 422 | "legendFormat": "__auto", 423 | "range": false, 424 | "refId": "A" 425 | } 426 | ], 427 | "title": "Node State", 428 | "transformations": [ 429 | { 430 | "id": "groupingToMatrix", 431 | "options": { 432 | "columnField": "state", 433 | "emptyValue": "null", 434 | "rowField": "node", 435 | "valueField": "Value" 436 | } 437 | }, 438 | { 439 | "id": "organize", 440 | "options": { 441 | "excludeByName": {}, 442 | "indexByName": {}, 443 | "renameByName": { 444 | "activating": "Activating", 445 | "active": "Active", 446 | "deactivating": "Deactivating", 447 | "failed": "Failed", 448 | "inactive": "Inactive", 449 | "node\\state": "Node" 450 | } 451 | } 452 | } 453 | ], 454 | "type": "table" 455 | }, 456 | { 457 | "datasource": { 458 | "type": "prometheus", 459 | "uid": "${DS_PROMETHEUS}" 460 | }, 461 | "fieldConfig": { 462 | "defaults": { 463 | "color": { 464 | "mode": "thresholds" 465 | }, 466 | "custom": { 467 | "align": "auto", 468 | "cellOptions": { 469 | "type": "auto" 470 | }, 471 | "inspect": false 472 | }, 473 | "mappings": [], 474 | "thresholds": { 475 | "mode": "absolute", 476 | "steps": [ 477 | { 478 | "color": "green", 479 | "value": null 480 | }, 481 | { 482 | "color": "red", 483 | "value": 80 484 | } 485 | ] 486 | } 487 | }, 488 | "overrides": [] 489 | }, 490 | "gridPos": { 491 | "h": 11, 492 | "w": 8, 493 | "x": 0, 494 | "y": 21 495 | }, 496 | "id": 14, 497 | "options": { 498 | "cellHeight": "sm", 499 | "footer": { 500 | "countRows": false, 501 | "fields": "", 502 | "reducer": [ 503 | "sum" 504 | ], 505 | "show": false 506 | }, 507 | "showHeader": true 508 | }, 509 | "pluginVersion": "10.1.4", 510 | "targets": [ 511 | { 512 | "datasource": { 513 | "type": "prometheus", 514 | "uid": "${DS_PROMETHEUS}" 515 | }, 516 | "editorMode": "code", 517 | "exemplar": false, 518 | "expr": "sum by(node, name) (node_systemd_unit_state{state=\"active\"} * on(instance, pod) group_left(node) label_replace(node_uname_info, \"node\", \"$1\", \"nodename\", \"(.*)\")) > 0", 519 | "format": "table", 520 | "instant": true, 521 | "legendFormat": "", 522 | "range": false, 523 | "refId": "A" 524 | } 525 | ], 526 | "title": "Active (all nodes)", 527 | "transformations": [ 528 | { 529 | "id": "organize", 530 | "options": { 531 | "excludeByName": { 532 | "Time": true, 533 | "Time\\Time": false, 534 | "Time\\name": false, 535 | "Value": true 536 | }, 537 | "indexByName": {}, 538 | "renameByName": { 539 | "1": "", 540 | "name": "Service", 541 | "node": "Node" 542 | } 543 | } 544 | } 545 | ], 546 | "type": "table" 547 | }, 548 | { 549 | "datasource": { 550 | "type": "prometheus", 551 | "uid": "${DS_PROMETHEUS}" 552 | }, 553 | "fieldConfig": { 554 | "defaults": { 555 | "color": { 556 | "mode": "thresholds" 557 | }, 558 | "custom": { 559 | "align": "auto", 560 | "cellOptions": { 561 | "type": "auto" 562 | }, 563 | "inspect": false 564 | }, 565 | "mappings": [], 566 | "thresholds": { 567 | "mode": "absolute", 568 | "steps": [ 569 | { 570 | "color": "green", 571 | "value": null 572 | }, 573 | { 574 | "color": "red", 575 | "value": 80 576 | } 577 | ] 578 | } 579 | }, 580 | "overrides": [] 581 | }, 582 | "gridPos": { 583 | "h": 11, 584 | "w": 8, 585 | "x": 8, 586 | "y": 21 587 | }, 588 | "id": 16, 589 | "options": { 590 | "cellHeight": "sm", 591 | "footer": { 592 | "countRows": false, 593 | "fields": "", 594 | "reducer": [ 595 | "sum" 596 | ], 597 | "show": false 598 | }, 599 | "showHeader": true 600 | }, 601 | "pluginVersion": "10.1.4", 602 | "targets": [ 603 | { 604 | "datasource": { 605 | "type": "prometheus", 606 | "uid": "${DS_PROMETHEUS}" 607 | }, 608 | "editorMode": "code", 609 | "exemplar": false, 610 | "expr": "sum by(node, name) (node_systemd_unit_state{state=\"activating\"} * on(instance, pod) group_left(node) label_replace(node_uname_info, \"node\", \"$1\", \"nodename\", \"(.*)\")) > 0", 611 | "format": "table", 612 | "instant": true, 613 | "legendFormat": "", 614 | "range": false, 615 | "refId": "A" 616 | } 617 | ], 618 | "title": "Activating (all nodes)", 619 | "transformations": [ 620 | { 621 | "id": "organize", 622 | "options": { 623 | "excludeByName": { 624 | "Time": true, 625 | "Time\\Time": false, 626 | "Time\\name": false, 627 | "Value": true 628 | }, 629 | "indexByName": {}, 630 | "renameByName": { 631 | "1": "" 632 | } 633 | } 634 | } 635 | ], 636 | "type": "table" 637 | }, 638 | { 639 | "datasource": { 640 | "type": "prometheus", 641 | "uid": "${DS_PROMETHEUS}" 642 | }, 643 | "fieldConfig": { 644 | "defaults": { 645 | "color": { 646 | "mode": "thresholds" 647 | }, 648 | "custom": { 649 | "align": "auto", 650 | "cellOptions": { 651 | "type": "auto" 652 | }, 653 | "inspect": false 654 | }, 655 | "mappings": [], 656 | "thresholds": { 657 | "mode": "absolute", 658 | "steps": [ 659 | { 660 | "color": "green", 661 | "value": null 662 | }, 663 | { 664 | "color": "red", 665 | "value": 80 666 | } 667 | ] 668 | } 669 | }, 670 | "overrides": [] 671 | }, 672 | "gridPos": { 673 | "h": 11, 674 | "w": 8, 675 | "x": 16, 676 | "y": 21 677 | }, 678 | "id": 17, 679 | "options": { 680 | "cellHeight": "sm", 681 | "footer": { 682 | "countRows": false, 683 | "fields": "", 684 | "reducer": [ 685 | "sum" 686 | ], 687 | "show": false 688 | }, 689 | "showHeader": true 690 | }, 691 | "pluginVersion": "10.1.4", 692 | "targets": [ 693 | { 694 | "datasource": { 695 | "type": "prometheus", 696 | "uid": "${DS_PROMETHEUS}" 697 | }, 698 | "editorMode": "code", 699 | "exemplar": false, 700 | "expr": "sum by(node, name) (node_systemd_unit_state{state=\"deactivating\"} * on(instance, pod) group_left(node) label_replace(node_uname_info, \"node\", \"$1\", \"nodename\", \"(.*)\")) > 0", 701 | "format": "table", 702 | "instant": true, 703 | "legendFormat": "", 704 | "range": false, 705 | "refId": "A" 706 | } 707 | ], 708 | "title": "Deactivating (all nodes)", 709 | "transformations": [ 710 | { 711 | "id": "organize", 712 | "options": { 713 | "excludeByName": { 714 | "Time": true, 715 | "Time\\Time": false, 716 | "Time\\name": false, 717 | "Value": true 718 | }, 719 | "indexByName": {}, 720 | "renameByName": { 721 | "1": "" 722 | } 723 | } 724 | } 725 | ], 726 | "type": "table" 727 | } 728 | ], 729 | "refresh": "", 730 | "schemaVersion": 38, 731 | "style": "dark", 732 | "tags": [], 733 | "templating": { 734 | "list": [ 735 | { 736 | "current": { 737 | "selected": false, 738 | "text": "prometheus", 739 | "value": "prometheus" 740 | }, 741 | "hide": 0, 742 | "includeAll": false, 743 | "label": "Datasource", 744 | "multi": false, 745 | "name": "datasource", 746 | "options": [], 747 | "query": "prometheus", 748 | "refresh": 1, 749 | "regex": "", 750 | "skipUrlSync": false, 751 | "type": "datasource" 752 | } 753 | ] 754 | }, 755 | "time": { 756 | "from": "now-24h", 757 | "to": "now" 758 | }, 759 | "timepicker": {}, 760 | "timezone": "", 761 | "title": "Systemd Service Monitoring", 762 | "uid": "ozk-systemd-mon", 763 | "version": 1, 764 | "weekStart": "" 765 | } -------------------------------------------------------------------------------- /grafana/velero/onzack-velero-monitoring.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": { 7 | "type": "datasource", 8 | "uid": "grafana" 9 | }, 10 | "enable": true, 11 | "hide": true, 12 | "iconColor": "rgba(0, 211, 255, 1)", 13 | "name": "Annotations & Alerts", 14 | "target": { 15 | "limit": 100, 16 | "matchAny": false, 17 | "tags": [], 18 | "type": "dashboard" 19 | }, 20 | "type": "dashboard" 21 | } 22 | ] 23 | }, 24 | "description": "Stats for Velero backups", 25 | "editable": false, 26 | "fiscalYearStartMonth": 0, 27 | "gnetId": 11055, 28 | "graphTooltip": 1, 29 | "id": 2, 30 | "links": [], 31 | "liveNow": false, 32 | "panels": [ 33 | { 34 | "collapsed": false, 35 | "datasource": { 36 | "type": "prometheus", 37 | "uid": "prometheus" 38 | }, 39 | "gridPos": { 40 | "h": 1, 41 | "w": 24, 42 | "x": 0, 43 | "y": 0 44 | }, 45 | "id": 15, 46 | "panels": [], 47 | "title": "Backup", 48 | "type": "row" 49 | }, 50 | { 51 | "datasource": { 52 | "type": "prometheus", 53 | "uid": "${datasource}" 54 | }, 55 | "description": "The sum of one-off backup and schedule backup success total ", 56 | "fieldConfig": { 57 | "defaults": { 58 | "color": { 59 | "mode": "thresholds" 60 | }, 61 | "mappings": [ 62 | { 63 | "options": { 64 | "match": "null", 65 | "result": { 66 | "text": "N/A" 67 | } 68 | }, 69 | "type": "special" 70 | } 71 | ], 72 | "max": 100, 73 | "min": 0, 74 | "thresholds": { 75 | "mode": "absolute", 76 | "steps": [ 77 | { 78 | "color": "#d44a3a", 79 | "value": null 80 | }, 81 | { 82 | "color": "rgba(237, 129, 40, 0.89)", 83 | "value": 0.95 84 | }, 85 | { 86 | "color": "#299c46", 87 | "value": 0.99 88 | } 89 | ] 90 | }, 91 | "unit": "short" 92 | }, 93 | "overrides": [] 94 | }, 95 | "gridPos": { 96 | "h": 8, 97 | "w": 4, 98 | "x": 0, 99 | "y": 1 100 | }, 101 | "id": 24, 102 | "links": [], 103 | "maxDataPoints": 100, 104 | "options": { 105 | "colorMode": "value", 106 | "graphMode": "area", 107 | "justifyMode": "auto", 108 | "orientation": "auto", 109 | "reduceOptions": { 110 | "calcs": [ 111 | "lastNotNull" 112 | ], 113 | "fields": "", 114 | "values": false 115 | }, 116 | "textMode": "auto" 117 | }, 118 | "pluginVersion": "9.5.1", 119 | "targets": [ 120 | { 121 | "datasource": { 122 | "type": "prometheus", 123 | "uid": "${datasource}" 124 | }, 125 | "exemplar": false, 126 | "expr": "velero_backup_total", 127 | "format": "time_series", 128 | "instant": true, 129 | "interval": "", 130 | "intervalFactor": 1, 131 | "legendFormat": "", 132 | "refId": "A" 133 | } 134 | ], 135 | "title": "Backup Success Total", 136 | "type": "stat" 137 | }, 138 | { 139 | "datasource": { 140 | "type": "prometheus", 141 | "uid": "${datasource}" 142 | }, 143 | "description": "The Success Rate is lower when a Backup is running.", 144 | "fieldConfig": { 145 | "defaults": { 146 | "color": { 147 | "mode": "thresholds" 148 | }, 149 | "mappings": [ 150 | { 151 | "options": { 152 | "match": "null", 153 | "result": { 154 | "text": "N/A" 155 | } 156 | }, 157 | "type": "special" 158 | } 159 | ], 160 | "max": 100, 161 | "min": 0, 162 | "thresholds": { 163 | "mode": "absolute", 164 | "steps": [ 165 | { 166 | "color": "#d44a3a", 167 | "value": null 168 | }, 169 | { 170 | "color": "rgba(237, 129, 40, 0.89)", 171 | "value": 0.9 172 | }, 173 | { 174 | "color": "#299c46", 175 | "value": 0.99 176 | } 177 | ] 178 | }, 179 | "unit": "percentunit" 180 | }, 181 | "overrides": [] 182 | }, 183 | "gridPos": { 184 | "h": 8, 185 | "w": 4, 186 | "x": 4, 187 | "y": 1 188 | }, 189 | "id": 22, 190 | "links": [], 191 | "maxDataPoints": 100, 192 | "options": { 193 | "orientation": "horizontal", 194 | "reduceOptions": { 195 | "calcs": [ 196 | "lastNotNull" 197 | ], 198 | "fields": "", 199 | "values": false 200 | }, 201 | "showThresholdLabels": false, 202 | "showThresholdMarkers": true 203 | }, 204 | "pluginVersion": "9.5.1", 205 | "targets": [ 206 | { 207 | "datasource": { 208 | "type": "prometheus", 209 | "uid": "${datasource}" 210 | }, 211 | "editorMode": "code", 212 | "expr": "sum(velero_backup_success_total{schedule=~\"$schedule\"}) / sum(velero_backup_attempt_total{schedule=~\"$schedule\"})", 213 | "format": "time_series", 214 | "intervalFactor": 1, 215 | "legendFormat": "", 216 | "range": true, 217 | "refId": "A" 218 | } 219 | ], 220 | "title": "Backup Success Rate", 221 | "type": "gauge" 222 | }, 223 | { 224 | "datasource": { 225 | "type": "prometheus", 226 | "uid": "${datasource}" 227 | }, 228 | "fieldConfig": { 229 | "defaults": { 230 | "color": { 231 | "mode": "thresholds" 232 | }, 233 | "mappings": [ 234 | { 235 | "options": { 236 | "match": "null", 237 | "result": { 238 | "text": "N/A" 239 | } 240 | }, 241 | "type": "special" 242 | } 243 | ], 244 | "max": 100, 245 | "min": 0, 246 | "thresholds": { 247 | "mode": "absolute", 248 | "steps": [ 249 | { 250 | "color": "#d44a3a", 251 | "value": null 252 | }, 253 | { 254 | "color": "rgba(237, 129, 40, 0.89)", 255 | "value": 0.95 256 | }, 257 | { 258 | "color": "#299c46", 259 | "value": 0.99 260 | } 261 | ] 262 | }, 263 | "unit": "percentunit" 264 | }, 265 | "overrides": [] 266 | }, 267 | "gridPos": { 268 | "h": 8, 269 | "w": 4, 270 | "x": 8, 271 | "y": 1 272 | }, 273 | "id": 26, 274 | "links": [], 275 | "maxDataPoints": 100, 276 | "options": { 277 | "orientation": "horizontal", 278 | "reduceOptions": { 279 | "calcs": [ 280 | "lastNotNull" 281 | ], 282 | "fields": "", 283 | "values": false 284 | }, 285 | "showThresholdLabels": false, 286 | "showThresholdMarkers": true 287 | }, 288 | "pluginVersion": "9.5.1", 289 | "targets": [ 290 | { 291 | "datasource": { 292 | "type": "prometheus", 293 | "uid": "${datasource}" 294 | }, 295 | "exemplar": false, 296 | "expr": "sum(velero_backup_deletion_success_total{schedule=~\"$schedule\"}) / sum(velero_backup_deletion_attempt_total{schedule=~\"$schedule\"})", 297 | "format": "time_series", 298 | "instant": false, 299 | "interval": "", 300 | "intervalFactor": 1, 301 | "legendFormat": "", 302 | "refId": "A" 303 | } 304 | ], 305 | "title": "Backup Deletion Success Rate", 306 | "type": "gauge" 307 | }, 308 | { 309 | "datasource": { 310 | "type": "prometheus", 311 | "uid": "${datasource}" 312 | }, 313 | "fieldConfig": { 314 | "defaults": { 315 | "color": { 316 | "mode": "thresholds" 317 | }, 318 | "mappings": [ 319 | { 320 | "options": { 321 | "match": "null", 322 | "result": { 323 | "text": "N/A" 324 | } 325 | }, 326 | "type": "special" 327 | } 328 | ], 329 | "max": 100, 330 | "min": 0, 331 | "thresholds": { 332 | "mode": "absolute", 333 | "steps": [ 334 | { 335 | "color": "#d44a3a", 336 | "value": null 337 | }, 338 | { 339 | "color": "rgba(237, 129, 40, 0.89)", 340 | "value": 0.95 341 | }, 342 | { 343 | "color": "#299c46", 344 | "value": 0.99 345 | } 346 | ] 347 | }, 348 | "unit": "percentunit" 349 | }, 350 | "overrides": [] 351 | }, 352 | "gridPos": { 353 | "h": 8, 354 | "w": 4, 355 | "x": 12, 356 | "y": 1 357 | }, 358 | "id": 28, 359 | "links": [], 360 | "maxDataPoints": 100, 361 | "options": { 362 | "orientation": "horizontal", 363 | "reduceOptions": { 364 | "calcs": [ 365 | "lastNotNull" 366 | ], 367 | "fields": "", 368 | "values": false 369 | }, 370 | "showThresholdLabels": false, 371 | "showThresholdMarkers": true 372 | }, 373 | "pluginVersion": "9.5.1", 374 | "targets": [ 375 | { 376 | "datasource": { 377 | "type": "prometheus", 378 | "uid": "${datasource}" 379 | }, 380 | "exemplar": false, 381 | "expr": "sum(velero_volume_snapshot_success_total{schedule=~\"$schedule\"}) / sum(velero_volume_snapshot_attempt_total{schedule=~\"$schedule\"})\n", 382 | "format": "time_series", 383 | "interval": "", 384 | "intervalFactor": 1, 385 | "legendFormat": "", 386 | "refId": "A" 387 | } 388 | ], 389 | "title": "Volume Snapshot Success Rate", 390 | "type": "gauge" 391 | }, 392 | { 393 | "datasource": { 394 | "type": "prometheus", 395 | "uid": "${datasource}" 396 | }, 397 | "description": "for schedule backup use only", 398 | "fieldConfig": { 399 | "defaults": { 400 | "color": { 401 | "mode": "thresholds" 402 | }, 403 | "custom": { 404 | "align": "auto", 405 | "cellOptions": { 406 | "mode": "basic", 407 | "type": "color-background" 408 | }, 409 | "inspect": false 410 | }, 411 | "decimals": 2, 412 | "mappings": [], 413 | "thresholds": { 414 | "mode": "absolute", 415 | "steps": [ 416 | { 417 | "color": "dark-green", 418 | "value": null 419 | }, 420 | { 421 | "color": "dark-orange", 422 | "value": 24 423 | }, 424 | { 425 | "color": "dark-red", 426 | "value": 48 427 | } 428 | ] 429 | }, 430 | "unit": "short" 431 | }, 432 | "overrides": [ 433 | { 434 | "matcher": { 435 | "id": "byName", 436 | "options": "Hours since last Backup" 437 | }, 438 | "properties": [ 439 | { 440 | "id": "custom.align", 441 | "value": "left" 442 | } 443 | ] 444 | } 445 | ] 446 | }, 447 | "gridPos": { 448 | "h": 8, 449 | "w": 8, 450 | "x": 16, 451 | "y": 1 452 | }, 453 | "id": 30, 454 | "options": { 455 | "cellHeight": "sm", 456 | "footer": { 457 | "countRows": false, 458 | "fields": "", 459 | "reducer": [ 460 | "sum" 461 | ], 462 | "show": false 463 | }, 464 | "showHeader": true 465 | }, 466 | "pluginVersion": "9.5.1", 467 | "targets": [ 468 | { 469 | "datasource": { 470 | "type": "prometheus", 471 | "uid": "${datasource}" 472 | }, 473 | "exemplar": false, 474 | "expr": "(time() - velero_backup_last_successful_timestamp{schedule!=\"\"}) / 60 / 60", 475 | "instant": true, 476 | "interval": "", 477 | "legendFormat": "{{schedule}}", 478 | "refId": "A" 479 | } 480 | ], 481 | "title": "Hours since last Backup", 482 | "transformations": [ 483 | { 484 | "id": "reduce", 485 | "options": { 486 | "includeTimeField": false, 487 | "labelsToFields": false, 488 | "reducers": [ 489 | "lastNotNull" 490 | ] 491 | } 492 | }, 493 | { 494 | "id": "organize", 495 | "options": { 496 | "excludeByName": {}, 497 | "indexByName": {}, 498 | "renameByName": { 499 | "Field": "Schedule", 500 | "Last *": "Hours since last Backup" 501 | } 502 | } 503 | } 504 | ], 505 | "type": "table" 506 | }, 507 | { 508 | "datasource": { 509 | "type": "prometheus", 510 | "uid": "${datasource}" 511 | }, 512 | "fieldConfig": { 513 | "defaults": { 514 | "color": { 515 | "mode": "palette-classic" 516 | }, 517 | "custom": { 518 | "axisCenteredZero": false, 519 | "axisColorMode": "text", 520 | "axisLabel": "", 521 | "axisPlacement": "auto", 522 | "barAlignment": 0, 523 | "drawStyle": "line", 524 | "fillOpacity": 10, 525 | "gradientMode": "none", 526 | "hideFrom": { 527 | "legend": false, 528 | "tooltip": false, 529 | "viz": false 530 | }, 531 | "lineInterpolation": "linear", 532 | "lineWidth": 1, 533 | "pointSize": 5, 534 | "scaleDistribution": { 535 | "type": "linear" 536 | }, 537 | "showPoints": "never", 538 | "spanNulls": false, 539 | "stacking": { 540 | "group": "A", 541 | "mode": "none" 542 | }, 543 | "thresholdsStyle": { 544 | "mode": "off" 545 | } 546 | }, 547 | "links": [], 548 | "mappings": [], 549 | "thresholds": { 550 | "mode": "absolute", 551 | "steps": [ 552 | { 553 | "color": "green", 554 | "value": null 555 | }, 556 | { 557 | "color": "red", 558 | "value": 80 559 | } 560 | ] 561 | }, 562 | "unit": "short" 563 | }, 564 | "overrides": [] 565 | }, 566 | "gridPos": { 567 | "h": 8, 568 | "w": 12, 569 | "x": 0, 570 | "y": 9 571 | }, 572 | "id": 2, 573 | "options": { 574 | "legend": { 575 | "calcs": [ 576 | "lastNotNull" 577 | ], 578 | "displayMode": "table", 579 | "placement": "right", 580 | "showLegend": true 581 | }, 582 | "tooltip": { 583 | "mode": "multi", 584 | "sort": "none" 585 | } 586 | }, 587 | "pluginVersion": "8.5.5", 588 | "targets": [ 589 | { 590 | "datasource": { 591 | "type": "prometheus", 592 | "uid": "${datasource}" 593 | }, 594 | "expr": "sum(velero_backup_total)", 595 | "hide": false, 596 | "legendFormat": "Backup Total", 597 | "refId": "A" 598 | }, 599 | { 600 | "datasource": { 601 | "type": "prometheus", 602 | "uid": "${datasource}" 603 | }, 604 | "editorMode": "code", 605 | "expr": "velero_backup_active_total{schedule=~\"$schedule\"}\r\n#missing metric (https://github.com/vmware-tanzu/velero/issues/2254)", 606 | "hide": false, 607 | "legendFormat": "Backup {{schedule}}", 608 | "range": true, 609 | "refId": "D" 610 | } 611 | ], 612 | "title": "Total Backup Count", 613 | "type": "timeseries" 614 | }, 615 | { 616 | "datasource": { 617 | "type": "prometheus", 618 | "uid": "${datasource}" 619 | }, 620 | "fieldConfig": { 621 | "defaults": { 622 | "color": { 623 | "mode": "palette-classic" 624 | }, 625 | "custom": { 626 | "axisCenteredZero": false, 627 | "axisColorMode": "text", 628 | "axisLabel": "", 629 | "axisPlacement": "auto", 630 | "barAlignment": 0, 631 | "drawStyle": "line", 632 | "fillOpacity": 100, 633 | "gradientMode": "none", 634 | "hideFrom": { 635 | "legend": false, 636 | "tooltip": false, 637 | "viz": false 638 | }, 639 | "lineInterpolation": "stepAfter", 640 | "lineStyle": { 641 | "fill": "solid" 642 | }, 643 | "lineWidth": 1, 644 | "pointSize": 5, 645 | "scaleDistribution": { 646 | "type": "linear" 647 | }, 648 | "showPoints": "never", 649 | "spanNulls": false, 650 | "stacking": { 651 | "group": "A", 652 | "mode": "normal" 653 | }, 654 | "thresholdsStyle": { 655 | "mode": "off" 656 | } 657 | }, 658 | "decimals": 0, 659 | "links": [], 660 | "mappings": [], 661 | "thresholds": { 662 | "mode": "absolute", 663 | "steps": [ 664 | { 665 | "color": "green", 666 | "value": null 667 | }, 668 | { 669 | "color": "red", 670 | "value": 80 671 | } 672 | ] 673 | }, 674 | "unit": "short" 675 | }, 676 | "overrides": [ 677 | { 678 | "matcher": { 679 | "id": "byName", 680 | "options": "Backup deletion success" 681 | }, 682 | "properties": [ 683 | { 684 | "id": "color", 685 | "value": { 686 | "fixedColor": "blue", 687 | "mode": "fixed" 688 | } 689 | } 690 | ] 691 | }, 692 | { 693 | "matcher": { 694 | "id": "byName", 695 | "options": "Backup partial failure" 696 | }, 697 | "properties": [ 698 | { 699 | "id": "color", 700 | "value": { 701 | "fixedColor": "orange", 702 | "mode": "fixed" 703 | } 704 | } 705 | ] 706 | } 707 | ] 708 | }, 709 | "gridPos": { 710 | "h": 8, 711 | "w": 12, 712 | "x": 12, 713 | "y": 9 714 | }, 715 | "id": 8, 716 | "links": [], 717 | "options": { 718 | "legend": { 719 | "calcs": [ 720 | "mean", 721 | "max", 722 | "lastNotNull" 723 | ], 724 | "displayMode": "table", 725 | "placement": "right", 726 | "showLegend": true 727 | }, 728 | "tooltip": { 729 | "mode": "multi", 730 | "sort": "none" 731 | } 732 | }, 733 | "pluginVersion": "8.5.5", 734 | "targets": [ 735 | { 736 | "datasource": { 737 | "type": "prometheus", 738 | "uid": "${datasource}" 739 | }, 740 | "expr": "sum(increase(velero_backup_success_total{schedule=~\"$schedule\"}[1h])) > 0", 741 | "format": "time_series", 742 | "instant": false, 743 | "interval": "", 744 | "legendFormat": "Backup success", 745 | "refId": "A" 746 | }, 747 | { 748 | "datasource": { 749 | "type": "prometheus", 750 | "uid": "${datasource}" 751 | }, 752 | "expr": "sum(increase(velero_backup_failure_total{schedule=~\"$schedule\"}[1h])) > 0", 753 | "hide": false, 754 | "legendFormat": "Backup failure", 755 | "refId": "B" 756 | }, 757 | { 758 | "datasource": { 759 | "type": "prometheus", 760 | "uid": "${datasource}" 761 | }, 762 | "expr": "sum(increase(velero_backup_partial_failure_total{schedule=~\"$schedule\"}[1h])) > 0", 763 | "legendFormat": "Backup partial failure", 764 | "refId": "C" 765 | }, 766 | { 767 | "datasource": { 768 | "type": "prometheus", 769 | "uid": "${datasource}" 770 | }, 771 | "expr": "sum(increase(velero_backup_deletion_success_total{schedule=~\"$schedule\"}[1h])) > 0", 772 | "legendFormat": "Backup deletion success", 773 | "refId": "D" 774 | }, 775 | { 776 | "datasource": { 777 | "type": "prometheus", 778 | "uid": "${datasource}" 779 | }, 780 | "expr": "sum(increase(velero_backup_deletion_failure_total{schedule=~\"$schedule\"}[1h])) > 0", 781 | "legendFormat": "Backup deletion failure", 782 | "refId": "E" 783 | } 784 | ], 785 | "title": "Backups per Hour", 786 | "type": "timeseries" 787 | }, 788 | { 789 | "cards": {}, 790 | "color": { 791 | "cardColor": "#1F60C4", 792 | "colorScale": "linear", 793 | "colorScheme": "interpolateSpectral", 794 | "exponent": 0.5, 795 | "mode": "spectrum" 796 | }, 797 | "dataFormat": "tsbuckets", 798 | "datasource": { 799 | "type": "prometheus", 800 | "uid": "${datasource}" 801 | }, 802 | "fieldConfig": { 803 | "defaults": { 804 | "custom": { 805 | "hideFrom": { 806 | "legend": false, 807 | "tooltip": false, 808 | "viz": false 809 | }, 810 | "scaleDistribution": { 811 | "type": "linear" 812 | } 813 | } 814 | }, 815 | "overrides": [] 816 | }, 817 | "gridPos": { 818 | "h": 8, 819 | "w": 24, 820 | "x": 0, 821 | "y": 17 822 | }, 823 | "heatmap": {}, 824 | "hideZeroBuckets": false, 825 | "highlightCards": true, 826 | "id": 32, 827 | "legend": { 828 | "show": true 829 | }, 830 | "options": { 831 | "calculate": false, 832 | "calculation": {}, 833 | "cellGap": 2, 834 | "cellValues": {}, 835 | "color": { 836 | "exponent": 0.5, 837 | "fill": "#1F60C4", 838 | "mode": "scheme", 839 | "reverse": false, 840 | "scale": "exponential", 841 | "scheme": "Spectral", 842 | "steps": 128 843 | }, 844 | "exemplars": { 845 | "color": "rgba(255,0,255,0.7)" 846 | }, 847 | "filterValues": { 848 | "le": 1e-9 849 | }, 850 | "legend": { 851 | "show": true 852 | }, 853 | "rowsFrame": { 854 | "layout": "auto" 855 | }, 856 | "showValue": "never", 857 | "tooltip": { 858 | "show": true, 859 | "yHistogram": true 860 | }, 861 | "yAxis": { 862 | "axisPlacement": "left", 863 | "reverse": false, 864 | "unit": "s" 865 | } 866 | }, 867 | "pluginVersion": "9.5.1", 868 | "reverseYBuckets": false, 869 | "targets": [ 870 | { 871 | "datasource": { 872 | "type": "prometheus", 873 | "uid": "${datasource}" 874 | }, 875 | "editorMode": "code", 876 | "exemplar": false, 877 | "expr": "sum(increase(velero_backup_duration_seconds_bucket{schedule=~\"$schedule\",le!=\"+Inf\"}[1h])) by (le)", 878 | "format": "heatmap", 879 | "hide": false, 880 | "interval": "", 881 | "legendFormat": "{{le}}", 882 | "range": true, 883 | "refId": "B" 884 | } 885 | ], 886 | "title": "Backup Time Heatmap", 887 | "tooltip": { 888 | "show": true, 889 | "showHistogram": true 890 | }, 891 | "type": "heatmap", 892 | "xAxis": { 893 | "show": true 894 | }, 895 | "yAxis": { 896 | "format": "s", 897 | "logBase": 1, 898 | "show": true 899 | }, 900 | "yBucketBound": "auto" 901 | }, 902 | { 903 | "datasource": { 904 | "type": "prometheus", 905 | "uid": "${datasource}" 906 | }, 907 | "description": "If your Storage component creates the Volume-Snapshots and not Velero, for example with Longhorn, then this will not displayed in the panel.", 908 | "fieldConfig": { 909 | "defaults": { 910 | "color": { 911 | "mode": "palette-classic" 912 | }, 913 | "custom": { 914 | "axisCenteredZero": false, 915 | "axisColorMode": "text", 916 | "axisLabel": "", 917 | "axisPlacement": "auto", 918 | "barAlignment": 0, 919 | "drawStyle": "line", 920 | "fillOpacity": 10, 921 | "gradientMode": "none", 922 | "hideFrom": { 923 | "legend": false, 924 | "tooltip": false, 925 | "viz": false 926 | }, 927 | "lineInterpolation": "smooth", 928 | "lineWidth": 1, 929 | "pointSize": 5, 930 | "scaleDistribution": { 931 | "type": "linear" 932 | }, 933 | "showPoints": "never", 934 | "spanNulls": false, 935 | "stacking": { 936 | "group": "A", 937 | "mode": "none" 938 | }, 939 | "thresholdsStyle": { 940 | "mode": "off" 941 | } 942 | }, 943 | "decimals": 0, 944 | "links": [], 945 | "mappings": [], 946 | "thresholds": { 947 | "mode": "absolute", 948 | "steps": [ 949 | { 950 | "color": "green", 951 | "value": null 952 | }, 953 | { 954 | "color": "red", 955 | "value": 80 956 | } 957 | ] 958 | }, 959 | "unit": "decbytes" 960 | }, 961 | "overrides": [] 962 | }, 963 | "gridPos": { 964 | "h": 6, 965 | "w": 24, 966 | "x": 0, 967 | "y": 25 968 | }, 969 | "id": 18, 970 | "options": { 971 | "legend": { 972 | "calcs": [ 973 | "min", 974 | "mean", 975 | "max", 976 | "lastNotNull" 977 | ], 978 | "displayMode": "table", 979 | "placement": "right", 980 | "showLegend": true 981 | }, 982 | "tooltip": { 983 | "mode": "multi", 984 | "sort": "none" 985 | } 986 | }, 987 | "pluginVersion": "8.5.5", 988 | "targets": [ 989 | { 990 | "datasource": { 991 | "type": "prometheus", 992 | "uid": "${datasource}" 993 | }, 994 | "editorMode": "code", 995 | "expr": "avg by (schedule) (avg_over_time(velero_backup_tarball_size_bytes{schedule=~\"$schedule\"}[15m]))", 996 | "legendFormat": "{{schedule}}", 997 | "range": true, 998 | "refId": "A" 999 | }, 1000 | { 1001 | "datasource": { 1002 | "type": "prometheus", 1003 | "uid": "${datasource}" 1004 | }, 1005 | "editorMode": "code", 1006 | "expr": "avg_over_time(velero_backup_tarball_size_bytes{schedule!~\".+\"}[15m])", 1007 | "hide": false, 1008 | "legendFormat": "Non Scheduled", 1009 | "range": true, 1010 | "refId": "F" 1011 | } 1012 | ], 1013 | "title": "Backup Size per Schedule", 1014 | "type": "timeseries" 1015 | }, 1016 | { 1017 | "collapsed": false, 1018 | "datasource": { 1019 | "type": "prometheus", 1020 | "uid": "prometheus" 1021 | }, 1022 | "gridPos": { 1023 | "h": 1, 1024 | "w": 24, 1025 | "x": 0, 1026 | "y": 31 1027 | }, 1028 | "id": 17, 1029 | "panels": [], 1030 | "title": "Restore", 1031 | "type": "row" 1032 | }, 1033 | { 1034 | "datasource": { 1035 | "type": "prometheus", 1036 | "uid": "${datasource}" 1037 | }, 1038 | "description": "", 1039 | "fieldConfig": { 1040 | "defaults": { 1041 | "color": { 1042 | "mode": "thresholds" 1043 | }, 1044 | "mappings": [ 1045 | { 1046 | "options": { 1047 | "match": "null", 1048 | "result": { 1049 | "text": "N/A" 1050 | } 1051 | }, 1052 | "type": "special" 1053 | } 1054 | ], 1055 | "max": 100, 1056 | "min": 0, 1057 | "noValue": "0", 1058 | "thresholds": { 1059 | "mode": "absolute", 1060 | "steps": [ 1061 | { 1062 | "color": "#d44a3a" 1063 | }, 1064 | { 1065 | "color": "rgba(237, 129, 40, 0.89)", 1066 | "value": 0.95 1067 | }, 1068 | { 1069 | "color": "#299c46", 1070 | "value": 0.99 1071 | } 1072 | ] 1073 | }, 1074 | "unit": "short" 1075 | }, 1076 | "overrides": [] 1077 | }, 1078 | "gridPos": { 1079 | "h": 8, 1080 | "w": 4, 1081 | "x": 0, 1082 | "y": 32 1083 | }, 1084 | "id": 38, 1085 | "links": [], 1086 | "maxDataPoints": 100, 1087 | "options": { 1088 | "colorMode": "value", 1089 | "graphMode": "area", 1090 | "justifyMode": "auto", 1091 | "orientation": "auto", 1092 | "reduceOptions": { 1093 | "calcs": [ 1094 | "lastNotNull" 1095 | ], 1096 | "fields": "", 1097 | "values": false 1098 | }, 1099 | "textMode": "auto" 1100 | }, 1101 | "pluginVersion": "9.5.1", 1102 | "targets": [ 1103 | { 1104 | "datasource": { 1105 | "type": "prometheus", 1106 | "uid": "${datasource}" 1107 | }, 1108 | "exemplar": false, 1109 | "expr": "velero_restore_total", 1110 | "format": "time_series", 1111 | "instant": true, 1112 | "interval": "", 1113 | "intervalFactor": 1, 1114 | "legendFormat": "", 1115 | "refId": "A" 1116 | } 1117 | ], 1118 | "title": "Restore Success Total", 1119 | "type": "stat" 1120 | }, 1121 | { 1122 | "datasource": { 1123 | "type": "prometheus", 1124 | "uid": "${datasource}" 1125 | }, 1126 | "fieldConfig": { 1127 | "defaults": { 1128 | "color": { 1129 | "mode": "thresholds" 1130 | }, 1131 | "mappings": [ 1132 | { 1133 | "options": { 1134 | "match": "null", 1135 | "result": { 1136 | "text": "N/A" 1137 | } 1138 | }, 1139 | "type": "special" 1140 | } 1141 | ], 1142 | "max": 100, 1143 | "min": 0, 1144 | "thresholds": { 1145 | "mode": "absolute", 1146 | "steps": [ 1147 | { 1148 | "color": "#d44a3a" 1149 | }, 1150 | { 1151 | "color": "rgba(237, 129, 40, 0.89)", 1152 | "value": 0.95 1153 | }, 1154 | { 1155 | "color": "#299c46", 1156 | "value": 0.99 1157 | } 1158 | ] 1159 | }, 1160 | "unit": "percentunit" 1161 | }, 1162 | "overrides": [] 1163 | }, 1164 | "gridPos": { 1165 | "h": 8, 1166 | "w": 4, 1167 | "x": 4, 1168 | "y": 32 1169 | }, 1170 | "id": 36, 1171 | "links": [], 1172 | "maxDataPoints": 100, 1173 | "options": { 1174 | "orientation": "horizontal", 1175 | "reduceOptions": { 1176 | "calcs": [ 1177 | "lastNotNull" 1178 | ], 1179 | "fields": "", 1180 | "values": false 1181 | }, 1182 | "showThresholdLabels": false, 1183 | "showThresholdMarkers": true 1184 | }, 1185 | "pluginVersion": "9.5.1", 1186 | "targets": [ 1187 | { 1188 | "datasource": { 1189 | "type": "prometheus", 1190 | "uid": "${datasource}" 1191 | }, 1192 | "exemplar": false, 1193 | "expr": "sum(velero_restore_success_total{schedule=~\"$schedule\"}) / sum(velero_restore_attempt_total{schedule=~\"$schedule\"})", 1194 | "format": "time_series", 1195 | "instant": false, 1196 | "interval": "", 1197 | "intervalFactor": 1, 1198 | "legendFormat": "", 1199 | "refId": "A" 1200 | } 1201 | ], 1202 | "title": "Restore Success Rate", 1203 | "type": "gauge" 1204 | }, 1205 | { 1206 | "datasource": { 1207 | "type": "prometheus", 1208 | "uid": "${datasource}" 1209 | }, 1210 | "fieldConfig": { 1211 | "defaults": { 1212 | "color": { 1213 | "mode": "palette-classic" 1214 | }, 1215 | "custom": { 1216 | "axisCenteredZero": false, 1217 | "axisColorMode": "text", 1218 | "axisLabel": "", 1219 | "axisPlacement": "auto", 1220 | "barAlignment": 0, 1221 | "drawStyle": "line", 1222 | "fillOpacity": 100, 1223 | "gradientMode": "none", 1224 | "hideFrom": { 1225 | "legend": false, 1226 | "tooltip": false, 1227 | "viz": false 1228 | }, 1229 | "lineInterpolation": "stepAfter", 1230 | "lineWidth": 1, 1231 | "pointSize": 5, 1232 | "scaleDistribution": { 1233 | "type": "linear" 1234 | }, 1235 | "showPoints": "never", 1236 | "spanNulls": false, 1237 | "stacking": { 1238 | "group": "A", 1239 | "mode": "normal" 1240 | }, 1241 | "thresholdsStyle": { 1242 | "mode": "off" 1243 | } 1244 | }, 1245 | "decimals": 0, 1246 | "links": [], 1247 | "mappings": [], 1248 | "thresholds": { 1249 | "mode": "absolute", 1250 | "steps": [ 1251 | { 1252 | "color": "green" 1253 | }, 1254 | { 1255 | "color": "red", 1256 | "value": 80 1257 | } 1258 | ] 1259 | }, 1260 | "unit": "short" 1261 | }, 1262 | "overrides": [] 1263 | }, 1264 | "gridPos": { 1265 | "h": 8, 1266 | "w": 16, 1267 | "x": 8, 1268 | "y": 32 1269 | }, 1270 | "id": 34, 1271 | "links": [], 1272 | "options": { 1273 | "legend": { 1274 | "calcs": [ 1275 | "mean", 1276 | "max", 1277 | "lastNotNull" 1278 | ], 1279 | "displayMode": "table", 1280 | "placement": "right", 1281 | "showLegend": true 1282 | }, 1283 | "tooltip": { 1284 | "mode": "multi", 1285 | "sort": "none" 1286 | } 1287 | }, 1288 | "pluginVersion": "9.1.7", 1289 | "targets": [ 1290 | { 1291 | "datasource": { 1292 | "type": "prometheus", 1293 | "uid": "${datasource}" 1294 | }, 1295 | "exemplar": false, 1296 | "expr": "round(sum(increase(velero_restore_success_total{schedule=~\"$schedule\"}[1h])))", 1297 | "format": "time_series", 1298 | "instant": false, 1299 | "interval": "", 1300 | "legendFormat": "Restore success", 1301 | "refId": "A" 1302 | }, 1303 | { 1304 | "datasource": { 1305 | "type": "prometheus", 1306 | "uid": "${datasource}" 1307 | }, 1308 | "exemplar": false, 1309 | "expr": "round(sum(increase(velero_restore_failed_total{schedule=~\"$schedule\"}[1h])))", 1310 | "hide": false, 1311 | "interval": "", 1312 | "legendFormat": "Restore failure", 1313 | "refId": "B" 1314 | }, 1315 | { 1316 | "datasource": { 1317 | "type": "prometheus", 1318 | "uid": "${datasource}" 1319 | }, 1320 | "exemplar": false, 1321 | "expr": "round(sum(increase(velero_restore_validation_failed_total{schedule=~\"$schedule\"}[1h])))", 1322 | "hide": false, 1323 | "interval": "", 1324 | "legendFormat": "Restore validation failure", 1325 | "refId": "C" 1326 | }, 1327 | { 1328 | "datasource": { 1329 | "type": "prometheus", 1330 | "uid": "${datasource}" 1331 | }, 1332 | "exemplar": false, 1333 | "expr": "round(sum(increase(velero_restore_partial_failure_total{schedule=~\"$schedule\"}[1h])))", 1334 | "hide": false, 1335 | "interval": "", 1336 | "legendFormat": "Restore partial failure", 1337 | "refId": "D" 1338 | } 1339 | ], 1340 | "title": "Restore per hour", 1341 | "type": "timeseries" 1342 | }, 1343 | { 1344 | "datasource": { 1345 | "type": "prometheus", 1346 | "uid": "${datasource}" 1347 | }, 1348 | "fieldConfig": { 1349 | "defaults": { 1350 | "color": { 1351 | "mode": "palette-classic" 1352 | }, 1353 | "custom": { 1354 | "axisCenteredZero": false, 1355 | "axisColorMode": "text", 1356 | "axisLabel": "", 1357 | "axisPlacement": "auto", 1358 | "barAlignment": 0, 1359 | "drawStyle": "line", 1360 | "fillOpacity": 10, 1361 | "gradientMode": "none", 1362 | "hideFrom": { 1363 | "legend": false, 1364 | "tooltip": false, 1365 | "viz": false 1366 | }, 1367 | "lineInterpolation": "linear", 1368 | "lineWidth": 1, 1369 | "pointSize": 5, 1370 | "scaleDistribution": { 1371 | "type": "linear" 1372 | }, 1373 | "showPoints": "never", 1374 | "spanNulls": false, 1375 | "stacking": { 1376 | "group": "A", 1377 | "mode": "none" 1378 | }, 1379 | "thresholdsStyle": { 1380 | "mode": "off" 1381 | } 1382 | }, 1383 | "links": [], 1384 | "mappings": [], 1385 | "thresholds": { 1386 | "mode": "absolute", 1387 | "steps": [ 1388 | { 1389 | "color": "green" 1390 | }, 1391 | { 1392 | "color": "red", 1393 | "value": 80 1394 | } 1395 | ] 1396 | }, 1397 | "unit": "short" 1398 | }, 1399 | "overrides": [] 1400 | }, 1401 | "gridPos": { 1402 | "h": 8, 1403 | "w": 24, 1404 | "x": 0, 1405 | "y": 40 1406 | }, 1407 | "id": 20, 1408 | "options": { 1409 | "legend": { 1410 | "calcs": [ 1411 | "lastNotNull" 1412 | ], 1413 | "displayMode": "table", 1414 | "placement": "right", 1415 | "showLegend": true 1416 | }, 1417 | "tooltip": { 1418 | "mode": "multi", 1419 | "sort": "none" 1420 | } 1421 | }, 1422 | "pluginVersion": "8.5.5", 1423 | "targets": [ 1424 | { 1425 | "datasource": { 1426 | "type": "prometheus", 1427 | "uid": "${datasource}" 1428 | }, 1429 | "editorMode": "code", 1430 | "expr": "sum(velero_restore_total)", 1431 | "legendFormat": "Restore Total", 1432 | "range": true, 1433 | "refId": "A" 1434 | } 1435 | ], 1436 | "title": "Total Restore Count", 1437 | "type": "timeseries" 1438 | }, 1439 | { 1440 | "collapsed": true, 1441 | "gridPos": { 1442 | "h": 1, 1443 | "w": 24, 1444 | "x": 0, 1445 | "y": 48 1446 | }, 1447 | "id": 40, 1448 | "panels": [ 1449 | { 1450 | "datasource": { 1451 | "type": "prometheus", 1452 | "uid": "${datasource}" 1453 | }, 1454 | "fieldConfig": { 1455 | "defaults": { 1456 | "color": { 1457 | "mode": "palette-classic" 1458 | }, 1459 | "custom": { 1460 | "axisCenteredZero": false, 1461 | "axisColorMode": "text", 1462 | "axisLabel": "", 1463 | "axisPlacement": "auto", 1464 | "barAlignment": 0, 1465 | "drawStyle": "line", 1466 | "fillOpacity": 100, 1467 | "gradientMode": "none", 1468 | "hideFrom": { 1469 | "legend": false, 1470 | "tooltip": false, 1471 | "viz": false 1472 | }, 1473 | "lineInterpolation": "stepAfter", 1474 | "lineWidth": 1, 1475 | "pointSize": 5, 1476 | "scaleDistribution": { 1477 | "type": "linear" 1478 | }, 1479 | "showPoints": "never", 1480 | "spanNulls": false, 1481 | "stacking": { 1482 | "group": "A", 1483 | "mode": "normal" 1484 | }, 1485 | "thresholdsStyle": { 1486 | "mode": "off" 1487 | } 1488 | }, 1489 | "decimals": 0, 1490 | "links": [], 1491 | "mappings": [], 1492 | "thresholds": { 1493 | "mode": "absolute", 1494 | "steps": [ 1495 | { 1496 | "color": "green" 1497 | }, 1498 | { 1499 | "color": "red", 1500 | "value": 80 1501 | } 1502 | ] 1503 | }, 1504 | "unit": "short" 1505 | }, 1506 | "overrides": [] 1507 | }, 1508 | "gridPos": { 1509 | "h": 9, 1510 | "w": 24, 1511 | "x": 0, 1512 | "y": 49 1513 | }, 1514 | "id": 42, 1515 | "links": [], 1516 | "options": { 1517 | "legend": { 1518 | "calcs": [ 1519 | "mean", 1520 | "max", 1521 | "lastNotNull" 1522 | ], 1523 | "displayMode": "table", 1524 | "placement": "right", 1525 | "showLegend": true 1526 | }, 1527 | "tooltip": { 1528 | "mode": "multi", 1529 | "sort": "none" 1530 | } 1531 | }, 1532 | "pluginVersion": "9.1.7", 1533 | "targets": [ 1534 | { 1535 | "datasource": { 1536 | "type": "prometheus", 1537 | "uid": "${datasource}" 1538 | }, 1539 | "editorMode": "code", 1540 | "exemplar": false, 1541 | "expr": "round(sum(increase(velero_csi_snapshot_attempt_total{schedule=~\"$schedule\", backupName=~\"$csi_backup_name\"}[1h])))", 1542 | "format": "time_series", 1543 | "instant": false, 1544 | "interval": "", 1545 | "legendFormat": "CSI Snapshot attempt", 1546 | "refId": "A" 1547 | }, 1548 | { 1549 | "datasource": { 1550 | "type": "prometheus", 1551 | "uid": "${datasource}" 1552 | }, 1553 | "exemplar": false, 1554 | "expr": "round(sum(increase(velero_csi_snapshot_success_total{schedule=~\"$schedule\", backupName=~\"$csi_backup_name\"}[1h])))", 1555 | "hide": false, 1556 | "interval": "", 1557 | "legendFormat": "CSI Snapshot success", 1558 | "refId": "B" 1559 | }, 1560 | { 1561 | "datasource": { 1562 | "type": "prometheus", 1563 | "uid": "${datasource}" 1564 | }, 1565 | "exemplar": false, 1566 | "expr": "round(sum(increase(velero_csi_snapshot_failure_total{schedule=~\"$schedule\", backupName=~\"$csi_backup_name\"}[1h])))", 1567 | "hide": false, 1568 | "interval": "", 1569 | "legendFormat": "CSI Snapshot failure", 1570 | "refId": "C" 1571 | } 1572 | ], 1573 | "title": "CSI per Hour", 1574 | "type": "timeseries" 1575 | } 1576 | ], 1577 | "title": "CSI", 1578 | "type": "row" 1579 | } 1580 | ], 1581 | "refresh": "", 1582 | "schemaVersion": 38, 1583 | "style": "dark", 1584 | "tags": [ 1585 | "velero", 1586 | "backup" 1587 | ], 1588 | "templating": { 1589 | "list": [ 1590 | { 1591 | "current": { 1592 | "selected": false, 1593 | "text": "prometheus", 1594 | "value": "prometheus" 1595 | }, 1596 | "hide": 0, 1597 | "includeAll": false, 1598 | "label": "Datasource", 1599 | "multi": false, 1600 | "name": "datasource", 1601 | "options": [], 1602 | "query": "prometheus", 1603 | "queryValue": "", 1604 | "refresh": 1, 1605 | "regex": "", 1606 | "skipUrlSync": false, 1607 | "type": "datasource" 1608 | }, 1609 | { 1610 | "current": { 1611 | "selected": true, 1612 | "text": [ 1613 | "All" 1614 | ], 1615 | "value": [ 1616 | "$__all" 1617 | ] 1618 | }, 1619 | "datasource": { 1620 | "uid": "$datasource" 1621 | }, 1622 | "definition": "label_values(velero_backup_attempt_total,schedule)", 1623 | "hide": 0, 1624 | "includeAll": true, 1625 | "label": "Schedule", 1626 | "multi": true, 1627 | "name": "schedule", 1628 | "options": [], 1629 | "query": { 1630 | "query": "label_values(velero_backup_attempt_total,schedule)", 1631 | "refId": "PrometheusVariableQueryEditor-VariableQuery" 1632 | }, 1633 | "refresh": 1, 1634 | "regex": "", 1635 | "skipUrlSync": false, 1636 | "sort": 1, 1637 | "tagValuesQuery": "", 1638 | "tagsQuery": "", 1639 | "type": "query", 1640 | "useTags": false 1641 | }, 1642 | { 1643 | "current": { 1644 | "selected": true, 1645 | "text": [ 1646 | "All" 1647 | ], 1648 | "value": [ 1649 | "$__all" 1650 | ] 1651 | }, 1652 | "datasource": { 1653 | "uid": "$datasource" 1654 | }, 1655 | "definition": "label_values(velero_csi_snapshot_attempt_total{schedule=~\"$schedule\"},backupName)", 1656 | "hide": 0, 1657 | "includeAll": true, 1658 | "label": "CSI Backup Name", 1659 | "multi": true, 1660 | "name": "csi_backup_name", 1661 | "options": [], 1662 | "query": { 1663 | "query": "label_values(velero_csi_snapshot_attempt_total{schedule=~\"$schedule\"},backupName)", 1664 | "refId": "PrometheusVariableQueryEditor-VariableQuery" 1665 | }, 1666 | "refresh": 1, 1667 | "regex": "", 1668 | "skipUrlSync": false, 1669 | "sort": 1, 1670 | "tagValuesQuery": "", 1671 | "tagsQuery": "", 1672 | "type": "query", 1673 | "useTags": false 1674 | } 1675 | ] 1676 | }, 1677 | "time": { 1678 | "from": "now-2d", 1679 | "to": "now" 1680 | }, 1681 | "timepicker": { 1682 | "hidden": false, 1683 | "refresh_intervals": [ 1684 | "5s", 1685 | "10s", 1686 | "30s", 1687 | "1m", 1688 | "5m", 1689 | "15m", 1690 | "30m", 1691 | "1h", 1692 | "2h", 1693 | "1d" 1694 | ] 1695 | }, 1696 | "timezone": "", 1697 | "title": "Velero Overview", 1698 | "uid": "ozk-vlr-mon", 1699 | "version": 21, 1700 | "weekStart": "" 1701 | } -------------------------------------------------------------------------------- /prometheus/recording-rules/README.md: -------------------------------------------------------------------------------- 1 | # OpenShift Workaround 2 | 3 | Unfortunately, there is a bug ([Bug 2037513](https://bugzilla.redhat.com/show_bug.cgi?id=2037513)) in cAdvisor/Kubelet in OpenShift. 4 | This error causes the label 'container' to be missing in the following metrics: 5 | 6 | - `container_fs_reads_bytes_total` 7 | - `container_fs_writes_bytes_total` 8 | - `container_fs_reads_total` 9 | - `container_fs_writes_total` 10 | 11 | **If you are using OpenShift, deploy PrometheusRule `onzack-namespace-monitoring-recording-rules-openshift-workaround.yaml` in your cluster.** 12 | -------------------------------------------------------------------------------- /prometheus/recording-rules/onzack-cluster-monitoring-recording-rules.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: monitoring.coreos.com/v1 2 | kind: PrometheusRule 3 | metadata: 4 | name: standard-cluster-monitoring-recording-rules 5 | spec: 6 | groups: 7 | - name: common 8 | rules: 9 | - record: instance:kube_node_role 10 | expr: topk by (node) (1,kube_node_role * on(node) group_left(instance) label_replace(node_uname_info, "node", "$1", "nodename", "(.*)")) 11 | - name: cpu 12 | rules: 13 | - record: node_cpu_seconds_total:sum_rate5m 14 | expr: sum by (cpu,instance,node,role) (rate(node_cpu_seconds_total{mode!="idle"}[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 15 | - record: kube_node_status_capacity:cpu:sum 16 | expr: sum by (node,role) (kube_node_status_capacity{resource="cpu"} * on(node) group_left(role) instance:kube_node_role) 17 | - record: role:kube_node_status_capacity:cpu:avg 18 | expr: avg by (role) (kube_node_status_capacity{resource="cpu"} * on(node) group_left(role) instance:kube_node_role) 19 | - record: kube_node_status_allocatable:cpu:sum 20 | expr: sum by (node,role) (kube_node_status_allocatable{resource="cpu"}* on(node) group_left(role) instance:kube_node_role) 21 | - record: role:kube_node_status_allocatable:cpu:avg 22 | expr: avg by (role) (kube_node_status_allocatable{resource="cpu"} * on(node) group_left(role) instance:kube_node_role) 23 | - name: memory 24 | rules: 25 | - record: node_memory_MemUsed_bytes:sum 26 | expr: |- 27 | sum by (instance,node,role) ( 28 | (node_memory_MemTotal_bytes{job="node-exporter"} - node_memory_MemAvailable_bytes{job="node-exporter"}) * on(instance) group_left(node,role) instance:kube_node_role 29 | ) 30 | - record: kube_node_status_capacity:memory:sum 31 | expr: sum by (node,role) (kube_node_status_capacity{resource="memory"} * on(node) group_left(role) instance:kube_node_role) 32 | - record: role:kube_node_status_capacity:memory:avg 33 | expr: avg by (role) (kube_node_status_capacity{resource="memory"} * on(node) group_left(role) instance:kube_node_role) 34 | - record: kube_node_status_allocatable:memory:sum 35 | expr: sum by (node,role) (kube_node_status_allocatable{resource="memory"} * on(node) group_left(role) instance:kube_node_role) 36 | - record: role:kube_node_status_allocatable:memory:avg 37 | expr: avg by (role) (kube_node_status_allocatable{resource="memory"} * on(node) group_left(role) instance:kube_node_role) 38 | - name: storage 39 | rules: 40 | - record: node_disk_read_bytes_total:sum_rate5m 41 | expr: sum by (instance,node,role) (rate(node_disk_read_bytes_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 42 | - record: node_disk_reads_completed_total:sum_rate5m 43 | expr: sum by (instance,node,role) (rate(node_disk_reads_completed_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 44 | - record: node_disk_read_time_seconds_total:sum_rate5m 45 | expr: sum by (instance,node,role) (rate(node_disk_read_time_seconds_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 46 | - record: node_disk_written_bytes_total:sum_rate5m 47 | expr: sum by (instance,node,role) (rate(node_disk_written_bytes_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 48 | - record: node_disk_writes_completed_total:sum_rate5m 49 | expr: sum by (instance,node,role) (rate(node_disk_writes_completed_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 50 | - record: node_disk_write_time_seconds_total:sum_rate5m 51 | expr: sum by (instance,node,role)(rate(node_disk_write_time_seconds_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 52 | - name: network 53 | rules: 54 | - record: node_network_receive_bytes_total:sum_rate5m 55 | expr: sum by (instance,node,role) (rate(node_network_receive_bytes_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 56 | - record: node_network_receive_packets_total:sum_rate5m 57 | expr: sum by (instance,node,role) (rate(node_network_receive_packets_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 58 | - record: node_network_receive_drop_total:sum_rate5m 59 | expr: sum by (instance,node,role) (rate(node_network_receive_drop_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 60 | - record: node_network_transmit_bytes_total:sum_rate5m 61 | expr: sum by (instance,node,role) (rate(node_network_transmit_bytes_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 62 | - record: node_network_transmit_packets_total:sum_rate5m 63 | expr: sum by (instance,node,role) (rate(node_network_transmit_packets_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 64 | - record: node_network_transmit_drop_total:sum_rate5m 65 | expr: sum by (instance,node,role)(rate(node_network_transmit_drop_total[5m]) * on(instance) group_left(node,role) instance:kube_node_role) 66 | - name: container_cpu 67 | rules: 68 | - record: container_cpu_usage_seconds_total:sum_rate5m:namespace 69 | expr: |- 70 | sum by (namespace,node,role) ( 71 | rate(container_cpu_usage_seconds_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) * on(node) group_left(role) instance:kube_node_role 72 | ) 73 | - record: container_memory_working_set_bytes:sum:namespace 74 | expr: |- 75 | sum by (namespace,node,role) ( 76 | container_memory_working_set_bytes{container!="", container!="POD"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) * on(node) group_left(role) instance:kube_node_role 77 | ) 78 | - record: kube_pod_container_resource_requests:cpu:running:namespace 79 | expr: |- 80 | sum by (namespace,node,role) ( 81 | kube_pod_container_resource_requests{resource="cpu"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) * on(node) group_left(role) instance:kube_node_role 82 | ) 83 | - record: kube_pod_container_resource_limits:cpu:running:namespace 84 | expr: |- 85 | sum by (namespace,node,role) ( 86 | kube_pod_container_resource_limits{resource="cpu"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) * on(node) group_left(role) instance:kube_node_role 87 | ) 88 | - record: kube_pod_container_resource_requests:memory:running:namespace 89 | expr: |- 90 | sum by (namespace,node,role) ( 91 | kube_pod_container_resource_requests{resource="memory"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) * on(node) group_left(role) instance:kube_node_role 92 | ) 93 | - record: kube_pod_container_resource_limits:memory:running:namespace 94 | expr: |- 95 | sum by (namespace,node,role) ( 96 | kube_pod_container_resource_limits{resource="memory"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) * on(node) group_left(role) instance:kube_node_role 97 | ) 98 | -------------------------------------------------------------------------------- /prometheus/recording-rules/onzack-namespace-monitoring-recording-rules-openshift-workaround.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: monitoring.coreos.com/v1 2 | kind: PrometheusRule 3 | metadata: 4 | name: standard-namespace-monitoring-recording-rules 5 | spec: 6 | groups: 7 | - name: cpu 8 | rules: 9 | - record: container_cpu_usage_seconds_total:sum_rate5m 10 | expr: |- 11 | sum by (uid,container,pod,namespace,node) ( 12 | label_replace( 13 | rate(container_cpu_usage_seconds_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 14 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 15 | ) 16 | - record: kube_pod_container_resource_requests:cpu:running 17 | expr: |- 18 | sum by (uid,container,pod,namespace,node) ( 19 | kube_pod_container_resource_requests{resource="cpu"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 20 | ) 21 | - record: kube_pod_container_resource_limits:cpu:running 22 | expr: |- 23 | sum by (uid,container,pod,namespace,node) ( 24 | kube_pod_container_resource_limits{resource="cpu"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 25 | ) 26 | - record: container_cpu_cfs_throttling:percent 27 | expr: |- 28 | 100 29 | / 30 | sum by (uid,container,pod,namespace,node) ( 31 | label_replace( 32 | increase(container_cpu_cfs_periods_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 33 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 34 | ) 35 | * 36 | sum by (uid,container,pod,namespace,node) ( 37 | label_replace( 38 | increase(container_cpu_cfs_throttled_periods_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 39 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 40 | ) 41 | - name: memory 42 | rules: 43 | - record: container_memory_working_set_bytes:sum 44 | expr: |- 45 | sum by (uid,container,pod,namespace,node) ( 46 | label_replace( 47 | container_memory_working_set_bytes{container!="", container!="POD"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 48 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 49 | ) 50 | - record: kube_pod_container_resource_requests:memory:running 51 | expr: |- 52 | sum by (uid,container,pod,namespace,node) ( 53 | kube_pod_container_resource_requests{resource="memory"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 54 | ) 55 | - record: kube_pod_container_resource_limits:memory:running 56 | expr: |- 57 | sum by (uid,container,pod,namespace,node) ( 58 | kube_pod_container_resource_limits{resource="memory"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 59 | ) 60 | - name: storage 61 | rules: 62 | - record: container_fs_reads_bytes_total:sum_rate5m 63 | expr: |- 64 | sum by (uid,container,pod,namespace,node) ( 65 | label_replace( 66 | rate(container_fs_reads_bytes_total{}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 67 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 68 | ) 69 | - record: container_fs_reads_total:sum_rate5m 70 | expr: |- 71 | sum by (uid,container,pod,namespace,node) ( 72 | label_replace( 73 | rate(container_fs_reads_total{}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 74 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 75 | ) 76 | - record: container_fs_writes_bytes_total:sum_rate5m 77 | expr: |- 78 | sum by (uid,container,pod,namespace,node) ( 79 | label_replace( 80 | rate(container_fs_writes_bytes_total{}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 81 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 82 | ) 83 | - record: container_fs_writes_total:sum_rate5m 84 | expr: |- 85 | sum by (uid,container,pod,namespace,node) ( 86 | label_replace( 87 | rate(container_fs_writes_total{}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 88 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 89 | ) 90 | - name: network 91 | rules: 92 | - record: container_network_receive_bytes_total:sum_rate5m 93 | expr: |- 94 | sum by (pod,namespace,node) ( 95 | rate(container_network_receive_bytes_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 96 | ) 97 | - record: container_network_receive_packets_total:sum_rate5m 98 | expr: |- 99 | sum by (pod,namespace,node) ( 100 | rate(container_network_receive_packets_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 101 | ) 102 | - record: container_network_receive_packets_dropped_total:sum_rate5m 103 | expr: |- 104 | sum by (pod,namespace,node) ( 105 | rate(container_network_receive_packets_dropped_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 106 | ) 107 | - record: container_network_transmit_bytes_total:sum_rate5m 108 | expr: |- 109 | sum by (pod,namespace,node) ( 110 | rate(container_network_transmit_bytes_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 111 | ) 112 | - record: container_network_transmit_packets_total:sum_rate5m 113 | expr: |- 114 | sum by (pod,namespace,node) ( 115 | rate(container_network_transmit_packets_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 116 | ) 117 | - record: container_network_transmit_packets_dropped_total:sum_rate5m 118 | expr: |- 119 | sum by (pod,namespace,node) ( 120 | rate(container_network_transmit_packets_dropped_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 121 | ) -------------------------------------------------------------------------------- /prometheus/recording-rules/onzack-namespace-monitoring-recording-rules.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: monitoring.coreos.com/v1 2 | kind: PrometheusRule 3 | metadata: 4 | name: standard-namespace-monitoring-recording-rules 5 | spec: 6 | groups: 7 | - name: cpu 8 | rules: 9 | - record: container_cpu_usage_seconds_total:sum_rate5m 10 | expr: |- 11 | sum by (uid,container,pod,namespace,node) ( 12 | label_replace( 13 | rate(container_cpu_usage_seconds_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 14 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 15 | ) 16 | - record: kube_pod_container_resource_requests:cpu:running 17 | expr: |- 18 | sum by (uid,container,pod,namespace,node) ( 19 | kube_pod_container_resource_requests{resource="cpu"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 20 | ) 21 | - record: kube_pod_container_resource_limits:cpu:running 22 | expr: |- 23 | sum by (uid,container,pod,namespace,node) ( 24 | kube_pod_container_resource_limits{resource="cpu"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 25 | ) 26 | - record: container_cpu_cfs_throttling:percent 27 | expr: |- 28 | 100 29 | / 30 | sum by (uid,container,pod,namespace,node) ( 31 | label_replace( 32 | increase(container_cpu_cfs_periods_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 33 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 34 | ) 35 | * 36 | sum by (uid,container,pod,namespace,node) ( 37 | label_replace( 38 | increase(container_cpu_cfs_throttled_periods_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 39 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 40 | ) 41 | - name: memory 42 | rules: 43 | - record: container_memory_working_set_bytes:sum 44 | expr: |- 45 | sum by (uid,container,pod,namespace,node) ( 46 | label_replace( 47 | container_memory_working_set_bytes{container!="", container!="POD"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 48 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 49 | ) 50 | - record: kube_pod_container_resource_requests:memory:running 51 | expr: |- 52 | sum by (uid,container,pod,namespace,node) ( 53 | kube_pod_container_resource_requests{resource="memory"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 54 | ) 55 | - record: kube_pod_container_resource_limits:memory:running 56 | expr: |- 57 | sum by (uid,container,pod,namespace,node) ( 58 | kube_pod_container_resource_limits{resource="memory"} * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 59 | ) 60 | - name: storage 61 | rules: 62 | - record: container_fs_reads_bytes_total:sum_rate5m 63 | expr: |- 64 | sum by (uid,container,pod,namespace,node) ( 65 | label_replace( 66 | rate(container_fs_reads_bytes_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 67 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 68 | ) 69 | - record: container_fs_reads_total:sum_rate5m 70 | expr: |- 71 | sum by (uid,container,pod,namespace,node) ( 72 | label_replace( 73 | rate(container_fs_reads_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 74 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 75 | ) 76 | - record: container_fs_writes_bytes_total:sum_rate5m 77 | expr: |- 78 | sum by (uid,container,pod,namespace,node) ( 79 | label_replace( 80 | rate(container_fs_writes_bytes_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 81 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 82 | ) 83 | - record: container_fs_writes_total:sum_rate5m 84 | expr: |- 85 | sum by (uid,container,pod,namespace,node) ( 86 | label_replace( 87 | rate(container_fs_writes_total{container!="", container!="POD"}[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 88 | , "uid", "$1-$2-$3-$4-$5", "id", ".+pod([a-zA-Z0-9]{8})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{4})(?:-|_)([a-zA-Z0-9]{12}).+") 89 | ) 90 | - name: network 91 | rules: 92 | - record: container_network_receive_bytes_total:sum_rate5m 93 | expr: |- 94 | sum by (pod,namespace,node) ( 95 | rate(container_network_receive_bytes_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 96 | ) 97 | - record: container_network_receive_packets_total:sum_rate5m 98 | expr: |- 99 | sum by (pod,namespace,node) ( 100 | rate(container_network_receive_packets_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 101 | ) 102 | - record: container_network_receive_packets_dropped_total:sum_rate5m 103 | expr: |- 104 | sum by (pod,namespace,node) ( 105 | rate(container_network_receive_packets_dropped_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 106 | ) 107 | - record: container_network_transmit_bytes_total:sum_rate5m 108 | expr: |- 109 | sum by (pod,namespace,node) ( 110 | rate(container_network_transmit_bytes_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 111 | ) 112 | - record: container_network_transmit_packets_total:sum_rate5m 113 | expr: |- 114 | sum by (pod,namespace,node) ( 115 | rate(container_network_transmit_packets_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 116 | ) 117 | - record: container_network_transmit_packets_dropped_total:sum_rate5m 118 | expr: |- 119 | sum by (pod,namespace,node) ( 120 | rate(container_network_transmit_packets_dropped_total[5m]) * on(pod, namespace) group_left() (kube_pod_status_phase{phase="Running"}==1) 121 | ) --------------------------------------------------------------------------------