1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
37 osm_metric_rules.yml: |
39 - name: osm_metric_rules
41 - record: vm_status_extended
42 expr: (last_over_time(vm_status[1m]) * on (vm_id, vim_id) group_left(ns_id, vnf_id, vdu_id, project_id, job, vdu_name, vnf_member_index) last_over_time(ns_topology[1m])) or (last_over_time(ns_topology[1m]) * -1)
46 expr: (0 * (count (vm_status_extended==0) by (ns_id, vnf_id)>=0)) or (min by (ns_id, vnf_id) (vm_status_extended))
50 expr: (0 * (count (vm_status_extended==0) by (ns_id)>=0)) or (min by (ns_id) (vm_status_extended))
53 osm_alert_rules.yml: |
55 - name: osm_alert_rules
58 expr: vm_status_extended != 1
61 summary: "VDU {{ $labels.vm_id }} in VIM {{ $labels.vim_id }} is down"
62 description: "VDU {{ $labels.vm_id }} in VIM {{ $labels.vim_id }} has been down for more than 3 minutes. NS instance id is {{ $labels.ns_id }}"
64 # Copyright 2018 The Prometheus Authors
65 # Copyright 2018 Whitestack
66 # Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U.
68 # Licensed under the Apache License, Version 2.0 (the "License");
69 # you may not use this file except in compliance with the License.
70 # You may obtain a copy of the License at
72 # http://www.apache.org/licenses/LICENSE-2.0
74 # Unless required by applicable law or agreed to in writing, software
75 # distributed under the License is distributed on an "AS IS" BASIS,
76 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
77 # See the License for the specific language governing permissions and
78 # limitations under the License.
82 scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
83 evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
84 # scrape_timeout is set to the global default (10s).
86 # Alertmanager configuration
93 # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
95 - "osm_metric_rules.yml"
96 - "osm_alert_rules.yml"
98 # A scrape configuration containing exactly one endpoint to scrape:
99 # Here it's Prometheus itself.
101 - job_name: 'mon_exporter'
103 - targets: ['mon:8000']
104 - job_name: pushgateway
109 - pushgateway-prometheus-pushgateway:9091
119 serviceName: prometheus
129 - name: prometheus-init-config
131 command: ["/bin/sh", "-c"]
132 args: ['if [ ! -f "/etc/prometheus/prometheus.yml" ]; then cp /config/prometheus.yml /etc/prometheus; fi; cp /config/osm_metric_rules.yml /config/osm_alert_rules.yml /etc/prometheus']
135 mountPath: /etc/prometheus
136 - name: prom-config-base
140 image: prom/prometheus:v2.28.1
142 - --config.file=/etc/prometheus/prometheus.yml
143 - --web.enable-lifecycle
145 - containerPort: 9090
149 mountPath: /etc/prometheus
151 mountPath: /prometheus
152 - name: prometheus-config-sidecar
153 image: opensourcemano/prometheus:13
156 value: mongodb://mongodb-k8s:27017/?replicaSet=rs0
157 - name: PROMETHEUS_CONFIG_FILE
158 value: /etc/prometheus/prometheus.yml
159 - name: PROMETHEUS_BASE_CONFIG_FILE
160 value: /etc/prometheus_base/prometheus.yml
161 - name: TARGET_DATABASE
163 - name: PROMETHEUS_URL
164 value: http://prometheus:9090
167 mountPath: /etc/prometheus
168 - name: prom-config-base
169 mountPath: /etc/prometheus_base
175 - name: prom-config-base