Commit Graph
15 Commits
Author SHA1 Message Date
ddadmin d55f183fc9 docs(course): добавлен урок по мониторингу стенда
- Зачем:
  - нужен завершённый урок 5, который объясняет мониторинг стенда без предположения, что менти уже знаком с Grafana.
- Что:
  - добавлен урок про Prometheus targets, Grafana dashboards, exporters и alert rules.
  - описан управляемый сбой через остановку airflow-scheduler и восстановление стенда.
  - обновлены навигация курса, план урока и названия панелей мониторинга в operations runbook.
- Проверка:
  - git diff --cached --check.
  - сверка названий dashboard/panel/alert rules с provisioning-файлами Grafana.
2026-06-05 20:20:42 +03:00
ddadmin 707da9f80e feat(airflow): добавлен гейт целостности DDS для урока 4
- Зачем:
  - урок 4 должен показывать не только измерение сирот в DDS, но и остановку Airflow DAG при нарушении связи dds.event -> dds.click.
- Что:
  - добавлен assert_dds_integrity в etl_pipeline и документация управляемого красного сценария.
  - вынесены общие helper'ы для SQL-split и boolean-параметров Airflow.
  - добавлен урок 4 и обновлены навигация курса, план обучения и operations notes.
- Проверка:
  - python3 -m py_compile airflow/dags/etl_pipeline_dag.py airflow/dags/ddl_init_dag.py airflow/dags/kafka_load_dag.py airflow/dags/utils/airflow_params.py airflow/dags/utils/sql_helpers.py.
  - docker compose exec -T airflow-webserver airflow dags test etl_pipeline 2026-06-05T18:00:00 -c '{"full_refresh": true}'.
2026-06-05 19:13:22 +03:00
ddadmin ec6111d260 fix(superset): stabilize bootstrap after clean reset
- make superset-init run via dedicated init service\n- tolerate missing dm views during early metadata refresh\n- add clickhouse dependency for init service\n- document clean-reset behavior and re-init flow
2026-02-11 09:48:56 +03:00
ddadmin 7819af8688 fix(superset): restore ClickHouse dialect and dataset metadata sync
- switch Superset ClickHouse URI back to clickhousedb://\n- refresh dataset metadata during init to restore filter columns\n- install runtime deps in image layer and add troubleshooting notes
2026-02-11 09:23:48 +03:00
ddadmin 0e470604fe chore(scripts): add make down and clean targets
- Why:
  - intensive development needs quick cluster stop/cleanup commands
  - current Makefile had only up and pipeline/monitoring targets
- What:
  - add make target down for standard docker compose shutdown
  - add make target clean for full cleanup with volumes and orphans
  - update OPERATIONS runbook with new make commands
- Check:
  - make -n down clean
2026-02-09 09:33:54 +03:00
ddadmin e851ef9788 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
2026-02-09 09:28:13 +03:00
ddadmin a310bc6c39 fix(monitoring): align airflow statsd mapping and reload flow
- Why:
  - Airflow task metrics were mapped to non-emitted StatsD keys
  - reload-monitoring did not restart statsd-exporter after mapping changes
- What:
  - update StatsD mapping for Airflow 2.10.5 metric names
  - remove problematic catch-all mapping that produced inconsistent series
  - restart statsd-exporter in reload-monitoring flow
  - sync operations runbook and airflow monitoring plan with actual metrics
- Check:
  - make reload-monitoring
  - Prometheus targets: airflow/clickhouse/kafka are UP
  - trigger ddl_init and verify airflow_task_duration_seconds_count
  - verify airflow_task_success_total and airflow_task_failures_total in Prometheus
2026-02-08 22:51:09 +03:00
ddadmin 4917a9a6ad feat(monitoring): add Airflow monitoring via statsd-exporter
- Add statsd-exporter service to docker-compose.yml (prom/statsd-exporter:v0.27.1)
- Add StatsD env vars to airflow-default-env for metrics export
- Add airflow job to prometheus.yml scrape configs
- Add Airflow Overview dashboard (Grafana provisioning)
- Add Airflow alert rules: scheduler down, queue backlog, failures, parse time
- Add configs/statsd_mapping.yml for StatsD → Prometheus conversion
- Use Prometheus naming convention (_total for counters, _seconds for timers)
- Add monitoring plan at plans/monitoring_airflow_plan.md
- Update OPERATIONS.md and Makefile for airflow monitoring

Tested: all 3 jobs (airflow, clickhouse, kafka) showing UP in Prometheus,
metrics flowing (dagbag_size=3, executor slots, heartbeats with _total suffix),
all 4 alert rules loaded in Grafana
2026-02-08 22:27:32 +03:00
ddadmin 8e31b06241 fix(monitoring): correct Kafka metrics and alert rules
- Why:
  - dashboard showed offset as throughput and produced misleading values
  - kafka-exporter metric/label naming was inconsistent across alerts/docs
  - consumer-group-missing alert was noisy for demo runs
- What:
  - switch throughput panel to rate(kafka_topic_partition_current_offset[5m]) aggregated by topic and exclude __* topics
  - align lag metric/labels to kafka_consumergroup_lag + consumergroup
  - remove Kafka Consumer Group Missing alert from provisioning
  - pin kafka-exporter image to v1.9.0 and update OPERATIONS.md checks
- Check:
  - airflow dags list-import-errors -> No data found
  - Prometheus targets: clickhouse up, kafka up
  - PromQL kafka_consumergroup_lag returns series
  - Grafana dashboards provisioning reload returns success
2026-02-08 21:52:21 +03:00
ddadmin afdfc98eef fix(infra): harden grafana permissions and document recovery
- Why:
  - students hit permission denied after pull and grafana restart-loop with readonly db
- What:
  - run grafana as default non-root user
  - mount provisioning directory as read-only
  - add troubleshooting for git permission issues and grafana volume reset
  - normalize file modes for data jsonl and docs/DE-task.md to 100644
- Check:
  - docker compose config
  - docker compose up -d grafana
  - curl -u admin:admin http://localhost:3000/api/health
2026-02-08 21:38:23 +03:00
ddadmin ae593fd08c feat(monitoring): add Kafka monitoring via kafka-exporter
- Add kafka-exporter service to docker-compose.yml
- Add kafka job to prometheus.yml scrape configs
- Add Kafka Overview dashboard (Grafana provisioning)
- Add Kafka alert rules (broker down, consumer lag, etc.)
- Add make reload-monitoring command for easy updates
- Update OPERATIONS.md with TL;DR and troubleshooting

API verified via Context7:
- /danielqsj/kafka_exporter for exporter config
- /prometheus/docs for scrape_configs format
2026-02-08 21:25:31 +03:00
ddadmin 41c867d68d docs(operations): add post-pull monitoring refresh runbook
- Why:
  - student needs a simple way to apply Grafana/monitoring config updates after git pull
- What:
  - add TL;DR block with minimal commands in monitoring section
  - add detailed post-pull runbook for datasource/dashboard/alerting reload
  - include clickhouse restart note for prometheus_ch.xml changes
- Check:
  - reviewed commands and paths in docs/OPERATIONS.md
2026-02-08 20:53:49 +03:00
ddadmin 5270273d8a feat(monitoring): add Grafana alert rules and fix datasource binding
- Why:
  - dashboard panels could resolve to stale datasource uid and show No data
  - monitoring required proactive alerts for ClickHouse health signals
- What:
  - pin dashboard panels to prometheus_uid and remove datasource templating variable
  - fix PromQL metrics for CPU, inserted rows, and parts panels
  - add provisioning alert rules for failed queries, memory resident, and active parts
  - pin Prometheus datasource uid and update monitoring documentation
- Check:
  - POST /api/admin/provisioning/datasources/reload
  - POST /api/admin/provisioning/dashboards/reload
  - POST /api/admin/provisioning/alerting/reload
  - GET /api/v1/provisioning/alert-rules
2026-02-08 20:49:31 +03:00
ddadmin fdeb48fdb2 feat(monitoring): add Grafana dashboard for ClickHouse
- Add Prometheus datasource provisioning config
- Add Grafana dashboard provider configuration
- Add ClickHouse Overview dashboard (JSON)
- Update README.md with monitoring section and updated stack badge
- Update docs/OPERATIONS.md with monitoring runbook

Dashboard includes:
- System Health: CPU, Memory Resident, Memory Code
- Query Performance: queries/sec, active queries, failed queries
- MergeTree Storage: parts count, merge rate

Verified via Context7: ClickHouse Prometheus metrics use ClickHouseAsyncMetrics_*,
ClickHouseMetrics_*, ClickHouseProfileEvents_* prefixes in v25.1.

Access:
- Grafana: http://localhost:3000 (admin/admin)
- Prometheus: http://localhost:9090
2026-02-08 20:29:43 +03:00
ddadmin 03de68e0c5 docs(docs): slim down AGENTS and split runbook sections
- Why:\n  - AGENTS.md became too large and mixed policy with operational details\n  - context7 requirement was easy to miss in long text\n- What:\n  - reduce AGENTS.md to a compact contributor contract\n  - add explicit mandatory MCP Context7 workflow block\n  - move runbook details to docs/OPERATIONS.md\n  - move artifact map to docs/REPO_MAP.md\n- Check:\n  - reviewed links and content after split\n  - ensured only documentation files are included in commit
2026-02-08 20:23:42 +03:00