Skip to content

Commit 9883b96

Browse files
authored
Adds static scrape configs for the snmp_exporter VMs running in each GCP project. (#111)
* Adds static scrape configs for the snmp_exporter VMs running in each GCP project. * Changes Prom config to be a template, and updates the apply-global script to evaluate the template and write the final config file.
1 parent b594d12 commit 9883b96

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

apply-global-prometheus.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ kubectl create configmap blackbox-config \
3434
--dry-run -o json | kubectl apply -f -
3535

3636
## Prometheus
37+
38+
# Evaluate the configuration template.
39+
sed -e 's|{{PROJECT}}|'${PROJECT}'|g' \
40+
config/federation/prometheus/prometheus.yml.template > \
41+
config/federation/prometheus/prometheus.yml
42+
43+
# Apply the above configmap.
3744
kubectl create configmap prometheus-federation-config \
3845
--from-literal=gcloud-project=${PROJECT} \
3946
--from-file=config/federation/prometheus \

config/federation/prometheus/prometheus.yml renamed to config/federation/prometheus/prometheus.yml.template

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,17 @@ scrape_configs:
284284
static_configs:
285285
- targets: ['nagios.measurementlab.net:9267']
286286

287+
288+
# Scrape config for the snmp_exporter. There is one snmp_exporter service
289+
# running in a Docker container on a GCE VM in each GCP project.
290+
#
291+
# The snmp_exporter generates its own labels.
292+
- job_name: 'snmp-exporter'
293+
static_configs:
294+
- targets:
295+
- snmp-exporter.{{PROJECT}}.measurementlab.net:9116/metrics
296+
297+
287298
# Scrape config for federation.
288299
#
289300
# The '/federate' target allows retrieving a set of timeseries from other

0 commit comments

Comments
 (0)