fix(monitoring): add recover flow for stuck monitoring stack
- Why: - during intensive development monitoring can get stuck (No data, out of bounds) - regular reload is not always enough to recover Prometheus + StatsD pipeline - What: - add make target recover-monitoring for hard recovery path - recreate prometheus and statsd-exporter, restart airflow scheduler/webserver - keep Grafana provisioning reload and target checks in one command - document when to use recover-monitoring in OPERATIONS runbook - Check: - run make recover-monitoring - verify Prometheus targets for airflow/clickhouse/kafka are up
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.PHONY: up ddl data transform reload-monitoring
|
||||
.PHONY: up ddl data transform reload-monitoring recover-monitoring
|
||||
|
||||
COMPOSE ?= docker compose
|
||||
|
||||
@@ -26,3 +26,18 @@ reload-monitoring:
|
||||
@curl -s -u admin:admin -X POST http://localhost:3000/api/admin/provisioning/alerting/reload && echo " [alerting]"
|
||||
@echo "=== Проверка ==="
|
||||
@curl -s http://localhost:9090/api/v1/targets | grep -o '"job":"[^"]*"' | sort | uniq
|
||||
|
||||
# Восстановление мониторинга после сбоев (например, out of bounds / пустые дашборды)
|
||||
recover-monitoring:
|
||||
@echo "=== Восстановление мониторинга (жесткий режим) ==="
|
||||
$(COMPOSE) rm -sf prometheus statsd-exporter
|
||||
$(COMPOSE) up -d prometheus grafana kafka-exporter statsd-exporter
|
||||
$(COMPOSE) restart airflow-scheduler airflow-webserver
|
||||
@echo "=== Перезагрузка provisioning Grafana ==="
|
||||
@sleep 2
|
||||
@curl -s -u admin:admin -X POST http://localhost:3000/api/admin/provisioning/datasources/reload && echo " [datasources]"
|
||||
@curl -s -u admin:admin -X POST http://localhost:3000/api/admin/provisioning/dashboards/reload && echo " [dashboards]"
|
||||
@curl -s -u admin:admin -X POST http://localhost:3000/api/admin/provisioning/alerting/reload && echo " [alerting]"
|
||||
@echo "=== Проверка targets ==="
|
||||
@curl -s http://localhost:9090/api/v1/targets | grep -o '"job":"[^"]*"' | sort | uniq
|
||||
@curl -s http://localhost:9090/api/v1/targets | grep -o '"health":"[^"]*"' | sort | uniq -c
|
||||
|
||||
Reference in New Issue
Block a user