X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Fhelm%2Fosm%2Ftemplates%2Fprometheus%2Fprometheus-prom-configmap.yaml;fp=installers%2Fhelm%2Fosm%2Ftemplates%2Fprometheus%2Fprometheus-prom-configmap.yaml;h=18fef224c076286c2dd55462b2fa25c66392ea39;hb=8080e4b32d3dc5e66ea85a503a4daa79df3098d0;hp=0000000000000000000000000000000000000000;hpb=5308be9dfe8efc5341b5d33f62621241e05cf4af;p=osm%2Fdevops.git diff --git a/installers/helm/osm/templates/prometheus/prometheus-prom-configmap.yaml b/installers/helm/osm/templates/prometheus/prometheus-prom-configmap.yaml new file mode 100644 index 00000000..18fef224 --- /dev/null +++ b/installers/helm/osm/templates/prometheus/prometheus-prom-configmap.yaml @@ -0,0 +1,87 @@ +{{- if .Values.prometheus.enabled -}} +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +####################################################################################### +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "osm.fullname" . }}-prometheus-prom-configmap + labels: + {{- include "osm.labels" . | nindent 4 }} +data: + prometheus.yml: | + # Copyright 2018 The Prometheus Authors + # Copyright 2018 Whitestack + # Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + + # my global config + global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + + # Alertmanager configuration + alerting: + alertmanagers: + - static_configs: + - targets: +{{- if .Values.global.oldServiceAssurance }} + # - alertmanager:9093 +{{- else }} + - alertmanager:9093 +{{- end }} + # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +{{- if .Values.global.oldServiceAssurance }} + rule_files: + # - "first_rules.yml" + # - "second_rules.yml" +{{- else }} + rule_files: + - "osm_metric_rules.yml" + - "osm_alert_rules.yml" +{{- end }} + # A scrape configuration containing exactly one endpoint to scrape: + # Here it's Prometheus itself. + scrape_configs: + - job_name: 'mon_exporter' + static_configs: + - targets: ['mon:8000'] +{{- if .Values.global.oldServiceAssurance }} + # Add here other external targets, e.g. a pushgateway + # - job_name: 'pushgateway' + # static_configs: + # - targets: ['prometheus-pushgateway:9091'] +{{- else }} + - job_name: pushgateway + honor_labels: true + scrape_interval: 30s + static_configs: + - targets: + - pushgateway-prometheus-pushgateway:9091 +{{- end }} +{{- end }} \ No newline at end of file