Skip to content

Commit 7791f5b

Browse files
authored
Fixes scraping of the production Autojoin Prom instances (#1081)
Previously, it was trying to scrape a hostname that didn't exist. The production Autojoin Prom instances runs in the mlab-autojoin project, not mlab-oti.
1 parent ed78103 commit 7791f5b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

apply-global-prometheus.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ kubectl create secret generic discuss-credentials \
5252

5353
# Evaluate the Prometheus configuration template.
5454
sed -e 's|{{PROJECT}}|'${PROJECT}'|g' \
55+
-e 's|{{AUTOJOIN_PROJECT}}|'${AUTOJOIN_PROJECT}'|g' \
5556
-e 's|{{BBE_IPV6_PORT}}|'${!bbe_port}'|g' \
5657
-e 's|{{REBOOTAPI_BASIC_AUTH}}|'${!REBOOTAPI_BASIC_AUTH_USER}'|g' \
5758
-e 's|{{REBOOTAPI_BASIC_AUTH_PASS}}|'${!REBOOTAPI_BASIC_AUTH_PASS}'|g' \

config.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ set -x
55
USAGE="PROJECT=<projectid> CLUSTER=<cluster> $0"
66
PROJECT=${PROJECT:?Please provide project id: $USAGE}
77
CLUSTER=${CLUSTER:?Please provide cluster name: $USAGE}
8+
AUTOJOIN_PROJECT=$PROJECT
9+
10+
# The production Autojoin GCP project is different from the usual mlab-oti
11+
# production project.
12+
if [[ $PROJECT == "mlab-oti" ]]; then
13+
AUTOJOIN_PROJECT="mlab-autojoin"
14+
fi
815

916
K8S_INGRESS_NGINX_VERSION="4.2.1"
1017

config/federation/prometheus/prometheus.yml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ scrape_configs:
425425
'match[]':
426426
- 'script_success'
427427
static_configs:
428-
- targets: ['prometheus-autojoin-basic.{{PROJECT}}.measurementlab.net']
428+
- targets: ['prometheus-autojoin-basic.{{AUTOJOIN_PROJECT}}.measurementlab.net']
429429
labels:
430430
cluster: "autojoin"
431431

0 commit comments

Comments
 (0)