Prometheus: Add feature-gate support in deployment scripts

This updates the deployment scripts for Prometheus to leverage the
feature gate functionality rather than bash generation of the list
of override files to use for alerting rules

Change-Id: Ie497ae930f7cc4db690a4ddc812a92e4491cde93
Signed-off-by: Steve Wilkerson <sw5822@att.com>
This commit is contained in:
Steve Wilkerson 2019-12-04 08:48:20 -06:00 committed by Tin Lam
parent e2a60422df
commit ddd5a74319
3 changed files with 11 additions and 25 deletions

View File

@ -1,26 +1,8 @@
conf:
prometheus:
rules:
logging:
elasticsearch:
groups:
- name: fluentd.rules
rules:
- alert: prom_exporter_fluentd_unavailable
expr: absent(fluentd_up)
for: 10m
labels:
severity: warning
annotations:
description: Fluentd exporter is not collecting metrics or is not available for past 10 minutes
title: Fluentd exporter is not collecting metrics or is not available
- alert: fluentd_not_running
expr: fluentd_up == 0
for: 5m
labels:
severity: page
annotations:
description: 'fluentd is down on {{$labels.instance}} for more than 5 minutes'
summary: 'Fluentd is down'
- name: elasticsearch.rules
rules:
- alert: prom_exporter_elasticsearch_unavailable

View File

@ -19,10 +19,15 @@ set -xe
#NOTE: Lint and package chart
make prometheus
FEATURE_GATES="alertmanager,ceph,elasticsearch,kubernetes,nodes,openstack,postgresql"
: ${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS:="$({ ./tools/deployment/common/get-values-overrides.sh prometheus;} 2> /dev/null)"}
#NOTE: Deploy command
helm upgrade --install prometheus ./prometheus \
--namespace=osh-infra \
--set pod.replicas.prometheus=2
--set pod.replicas.prometheus=2 \
${OSH_INFRA_EXTRA_HELM_ARGS} \
${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS}
#NOTE: Wait for deploy
./tools/deployment/common/wait-for-pods.sh osh-infra

View File

@ -19,15 +19,14 @@ set -xe
#NOTE: Lint and package chart
make prometheus
rules_overrides=""
for rules_file in $(ls ./prometheus/values_overrides); do
rules_overrides="$rules_overrides --values=./prometheus/values_overrides/$rules_file"
done
FEATURE_GATES="alertmanager,ceph,elasticsearch,kubernetes,nodes,openstack,postgresql"
: ${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS:="$({ ./tools/deployment/common/get-values-overrides.sh prometheus;} 2> /dev/null)"}
#NOTE: Deploy command
helm upgrade --install prometheus ./prometheus \
--namespace=osh-infra \
$rules_overrides
${OSH_INFRA_EXTRA_HELM_ARGS} \
${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS}
#NOTE: Wait for deploy
./tools/deployment/common/wait-for-pods.sh osh-infra