Implement lab6 observability with OpenTelemetry and Grafana

This commit is contained in:
2026-11-19 16:36:40 +03:00
parent 470d9d6f1e
commit 8c253a0e5a
149 changed files with 11752 additions and 229 deletions
+39 -13
View File
@@ -1,30 +1,56 @@
PYTHON ?= python3
BASE_URL ?= http://localhost:8080
BASE_URL ?= http://localhost:8086
CA_FILE ?=
ACTION_SCRIPT ?=
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
.PHONY: help check validate test load test-persistence test-failover
.PHONY: help up down migrate lint format check validate test load test-attachments test-idempotency test-api-regressions test-attachment-failover test-persistence test-failover test-lab5 test-lab5-faults verify-lab6 jobs-failed
help:
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
@echo "up: start; test: public lab6 smoke; test-observability: real signals; verify-lab6: quick acceptance"
up:
docker compose up -d --build --wait
down:
docker compose down
migrate:
docker compose run --rm migration
lint:
$(PYTHON) -m ruff check src
$(PYTHON) -m ruff format --check src
format:
$(PYTHON) -m ruff check --fix src
$(PYTHON) -m ruff format src
check:
$(PYTHON) scripts/check_contract.py
validate:
$(PYTHON) scripts/validate_openapi.py
test:
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
load:
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
test-attachments:
$(PYTHON) tests/attachments.py --base-url "$(BASE_URL)" $(TLS_ARGS)
test-idempotency:
$(PYTHON) tests/idempotency.py --base-url "$(BASE_URL)"
test-api-regressions:
$(PYTHON) tests/api_regressions.py --base-url "$(BASE_URL)" $(TLS_ARGS)
test-attachment-failover:
$(PYTHON) tests/attachment_failover.py --base-url "$(BASE_URL)" $(TLS_ARGS)
test-persistence:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
$(PYTHON) tests/resilience.py --mode persistence --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT=scripts/restart.sh"; exit 2)
$(PYTHON) scripts/test-persistence.py --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
test-failover:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable stop-one hook"; exit 2)
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT=scripts/stop-one.sh"; exit 2)
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
test-lab5:
$(PYTHON) tests/lab5.py --base-url "$(BASE_URL)"
test-lab5-faults:
@test -n "$(COMPOSE_PROJECT_NAME)" || (echo "Set COMPOSE_PROJECT_NAME to your isolated test project"; exit 2)
$(PYTHON) tests/lab5.py --faults --project "$(COMPOSE_PROJECT_NAME)" --base-url "$(BASE_URL)"
verify-lab6:
$(PYTHON) scripts/verify-lab6.py
jobs-failed:
docker compose exec -T dispatcher python -m src.pipeline.admin failed
.PHONY: test-observability
test-observability:
$(PYTHON) tests/observability.py --base-url "$(BASE_URL)"