feat(common): complete Phase 1 - project config, structured logging, and ClickHouse DDL

This commit is contained in:
2026-09-19 13:12:04 +03:30
parent 5f75a1a2be
commit 43df200eeb
9 changed files with 364 additions and 3 deletions

51
.env.example Normal file
View File

@@ -0,0 +1,51 @@
# ==========================================
# Ingestion API Configuration
# ==========================================
API_HOST=0.0.0.0
API_PORT=8000
API_QUEUE_MAX_SIZE=10000
WORKER_STATS_URL=http://worker:8001/internal/stats
# ==========================================
# Processing Worker Configuration
# ==========================================
WORKER_INSTANCE=worker-1
WORKER_STATS_HOST=0.0.0.0
WORKER_STATS_PORT=8001
# ==========================================
# Kafka / Redpanda Broker Configuration
# ==========================================
KAFKA_BOOTSTRAP_SERVERS=kafka:9092
KAFKA_RAW_TOPIC=cdr.raw
KAFKA_DLQ_TOPIC=cdr.raw.dlq
KAFKA_CONSUMER_GROUP=cdr-processing-group
KAFKA_AUTO_OFFSET_RESET=earliest
# ==========================================
# ClickHouse Database Configuration
# ==========================================
CLICKHOUSE_HOST=clickhouse
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=
CLICKHOUSE_DATABASE=telecom
CLICKHOUSE_TABLE=cdr_records
# ==========================================
# Micro-Batching Settings
# ==========================================
BATCH_SIZE=1000
BATCH_FLUSH_INTERVAL_SECONDS=2
# ==========================================
# ClickHouse Timeout Retry Policy
# ==========================================
CH_RETRY_MAX_ATTEMPTS=3
CH_RETRY_INITIAL_DELAY_MS=500
CH_RETRY_BACKOFF_FACTOR=2.0
# ==========================================
# Observability & Logging
# ==========================================
LOG_LEVEL=INFO