Skip to content

Commit 8cffcc8

Browse files
committed
Merge remote-tracking branch 'upstream/main' into 2024/add/tempo
2 parents 690b997 + 9c0d892 commit 8cffcc8

File tree

6 files changed

+32
-20
lines changed

6 files changed

+32
-20
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- [ ] Service has placement constraints or is global
1919
- [ ] Service is restartable
2020
- [ ] Service restart is zero-downtime
21+
- [ ] Service is monitored (via prometheus and grafana)
2122
- [ ] Service is not bound to one specific node (e.g. via files or volumes)
2223
- [ ] Relevant OPS E2E Test are added
23-
- [ ] Service's Public URL is included in maintenance mode -->
24+
- [ ] Service's Public URL is included in maintenance mode
25+
- [ ] Service's Public URL is included in testing mode -->

services/monitoring/Makefile

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,4 @@ tempo_config.yaml: tempo_config.yaml.j2 ${REPO_CONFIG_LOCATION} .env .venv
153153

154154
.PHONY: grafana/assets
155155
grafana/assets: ${REPO_CONFIG_LOCATION}
156-
@if [ ! -d "$(shell dirname ${REPO_CONFIG_LOCATION})/assets/grafana" ]; then \
157-
echo "Error: folder does not exist $$GRAFANA_ASSETS_DIR" >&2; \
158-
exit 1; \
159-
fi; \
160-
if [ ! -d "$(shell dirname ${REPO_CONFIG_LOCATION})/../shared/assets/grafana" ]; then \
161-
echo "Error: folder does not exist $$GRAFANA_COMMON_ASSETS_DIR" >&2; \
162-
exit 1; \
163-
fi; \
164-
rm -rf $(REPO_BASE_DIR)/services/monitoring/grafana/assets || true; \
165-
mkdir -p $(REPO_BASE_DIR)/services/monitoring/grafana/assets; \
166-
cp -r $(shell dirname ${REPO_CONFIG_LOCATION})/assets/grafana/* $(REPO_BASE_DIR)/services/monitoring/grafana/assets; \
167-
cp -r $(shell dirname ${REPO_CONFIG_LOCATION})/../shared/assets/grafana $(REPO_BASE_DIR)/services/monitoring/grafana/assets/shared; \
156+
@$(MAKE_C) grafana assets

services/monitoring/docker-compose.yml.j2

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,12 @@ services:
379379
networks:
380380
- monitored
381381
environment:
382-
REDIS_ADDR: redis://{{REDIS_HOST}}:{{REDIS_PORT}}
383-
REDIS_EXPORTER_CHECK_KEYS: db0=user_id*client_session_id*alive,db0=user_id*client_session_id*resources,db1=project_lock*,db3=*
382+
REDIS_ADDR: ${REDIS_ADDRESS}
383+
{%- if REDIS_USER %}
384+
REDIS_USER: ${REDIS_USER}
385+
{%- endif %}
384386
REDIS_PASSWORD: ${REDIS_PASSWORD}
387+
REDIS_EXPORTER_CHECK_KEYS: db0=user_id*client_session_id*alive,db0=user_id*client_session_id*resources,db1=project_lock*,db3=*
385388
deploy:
386389
labels:
387390
- prometheus-job=redis-exporter

services/monitoring/grafana/Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include ${REPO_BASE_DIR}/scripts/common.Makefile
66

77
# Internal VARIABLES ------------------------------------------------
88
TF_STATE_FILE := terraform/.terraform/terraform.tfstate
9-
9+
.PHONY: terraform/main.tf
1010
terraform/main.tf: terraform/main.tf.j2 .venv $(REPO_CONFIG_LOCATION)
1111
# generate $@
1212
@$(call jinja, $<, $(REPO_CONFIG_LOCATION), $@)
@@ -62,3 +62,18 @@ ensure-grafana-online:
6262
echo "Max attempts reached, Grafana is still unreachable."; \
6363
exit 1; \
6464
fi;
65+
66+
.PHONY: assets
67+
assets: ${REPO_CONFIG_LOCATION}
68+
@if [ ! -d "$(shell dirname ${REPO_CONFIG_LOCATION})/assets/grafana" ]; then \
69+
echo "Error: folder does not exist $$GRAFANA_ASSETS_DIR" >&2; \
70+
exit 1; \
71+
fi; \
72+
if [ ! -d "$(shell dirname ${REPO_CONFIG_LOCATION})/../shared/assets/grafana" ]; then \
73+
echo "Error: folder does not exist $$GRAFANA_COMMON_ASSETS_DIR" >&2; \
74+
exit 1; \
75+
fi; \
76+
rm -rf $(REPO_BASE_DIR)/services/monitoring/grafana/assets || true; \
77+
mkdir -p $(REPO_BASE_DIR)/services/monitoring/grafana/assets; \
78+
cp -r $(shell dirname ${REPO_CONFIG_LOCATION})/assets/grafana/* $(REPO_BASE_DIR)/services/monitoring/grafana/assets; \
79+
cp -r $(shell dirname ${REPO_CONFIG_LOCATION})/../shared/assets/grafana $(REPO_BASE_DIR)/services/monitoring/grafana/assets/shared; \

services/monitoring/grafana/terraform/main.tf.j2

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ terraform {
1212
encrypt = false
1313
bucket = "{{ TF_GRAFANA_STATE_BACKEND_S3_BUCKET_NAME }}"
1414
region = "{{ TF_GRAFANA_STATE_BACKEND_AWS_REGION }}"
15-
{% if GRAFANA_TERRAFORM_STATE_BACKEND_S3_ENDPOINT %}
15+
{% if "amazonaws.com" not in GRAFANA_TERRAFORM_STATE_BACKEND_S3_ENDPOINT %}
16+
# via https://github.com/hashicorp/terraform/issues/34086#issuecomment-1814188931
1617
skip_credentials_validation = true
1718
skip_requesting_account_id = true
1819
skip_metadata_api_check = true
20+
skip_region_validation = true
21+
skip_s3_checksum = true
1922
use_path_style = true
20-
endpoints = {
23+
endpoints = {
2124
s3 = "{{ GRAFANA_TERRAFORM_STATE_BACKEND_S3_ENDPOINT }}"
2225
}
2326
{% endif %}

services/monitoring/template.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ POSTGRES_PORT=${POSTGRES_PORT}
1313
POSTGRES_HOST=${POSTGRES_HOST}
1414
POSTGRES_ENDPOINT=${POSTGRES_ENDPOINT}
1515
PREFIX_STACK_NAME=${PREFIX_STACK_NAME}
16-
REDIS_PORT=${REDIS_PORT}
17-
REDIS_HOST=${REDIS_HOST}
16+
REDIS_USER=${REDIS_USER}
17+
REDIS_ADDRESS=${REDIS_ADDRESS}
1818
REDIS_PASSWORD=${REDIS_PASSWORD}
1919
MONITORING_PROMETHEUS_CEPH_TARGETS='${MONITORING_PROMETHEUS_CEPH_TARGETS}'
2020
MONITORING_PROMETHEUS_PGSQL_GID_MONITORED=${MONITORING_PROMETHEUS_PGSQL_GID_MONITORED}

0 commit comments

Comments
 (0)