Feature 8170: deploy OSM services with a helm chart
[osm/devops.git] / installers / helm / osm / templates / prometheus / prometheus-prom-configmap.yaml
1 {{- if .Values.prometheus.enabled -}}
2 #######################################################################################
3 # Copyright ETSI Contributors and Others.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #    http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #######################################################################################
18 apiVersion: v1
19 kind: ConfigMap
20 metadata:
21   name: {{ include "osm.fullname" . }}-prometheus-prom-configmap
22   labels:
23     {{- include "osm.labels" . | nindent 4 }}
24 data:
25   prometheus.yml: |
26     # Copyright 2018 The Prometheus Authors
27     # Copyright 2018 Whitestack
28     # Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U.
29     #
30     # Licensed under the Apache License, Version 2.0 (the "License");
31     # you may not use this file except in compliance with the License.
32     # You may obtain a copy of the License at
33     #
34     # http://www.apache.org/licenses/LICENSE-2.0
35     #
36     # Unless required by applicable law or agreed to in writing, software
37     # distributed under the License is distributed on an "AS IS" BASIS,
38     # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39     # See the License for the specific language governing permissions and
40     # limitations under the License.
41
42     # my global config
43     global:
44       scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
45       evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
46       # scrape_timeout is set to the global default (10s).
47
48     # Alertmanager configuration
49     alerting:
50       alertmanagers:
51       - static_configs:
52         - targets:
53 {{- if .Values.global.oldServiceAssurance }}
54           # - alertmanager:9093
55 {{- else }}
56           - alertmanager:9093
57 {{- end }}
58     # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
59 {{- if .Values.global.oldServiceAssurance }}
60     rule_files:
61       # - "first_rules.yml"
62       # - "second_rules.yml"
63 {{- else }}
64     rule_files:
65       - "osm_metric_rules.yml"
66       - "osm_alert_rules.yml"
67 {{- end }}
68     # A scrape configuration containing exactly one endpoint to scrape:
69     # Here it's Prometheus itself.
70     scrape_configs:
71       - job_name: 'mon_exporter'
72         static_configs:
73         - targets: ['mon:8000']
74 {{- if .Values.global.oldServiceAssurance }}
75       # Add here other external targets, e.g. a pushgateway
76       # - job_name: 'pushgateway'
77       #   static_configs:
78       #   - targets: ['prometheus-pushgateway:9091']
79 {{- else }}
80       - job_name: pushgateway
81         honor_labels: true
82         scrape_interval: 30s
83         static_configs:
84         - targets:
85           - pushgateway-prometheus-pushgateway:9091
86 {{- end }}
87 {{- end }}