# Environment variables for processor. # Copy to .env and fill in values for local development. # Required vars: REDIS_URL, POSTGRES_URL. # Runtime environment: development | test | production NODE_ENV=development # Unique identifier for this service instance. # Used in logs (base field), metrics labels, and as the default Redis consumer name. # IMPORTANT: must be unique per running instance for safe consumer-group operation. # If two instances share the same INSTANCE_ID they will also share REDIS_CONSUMER_NAME, # which causes consumer-group split-brain — the stream will not progress correctly. INSTANCE_ID=processor-1 # Log level: fatal | error | warn | info | debug | trace LOG_LEVEL=info # Redis connection URL — required; no default. REDIS_URL=redis://localhost:6379 # Postgres / TimescaleDB connection URL — required; no default. POSTGRES_URL=postgres://postgres:postgres@localhost:5432/trm # Redis Stream name to consume from. Must match tcp-ingestion's REDIS_TELEMETRY_STREAM. # In the deploy stack this is pinned via the shared REDIS_TELEMETRY_STREAM env # var so neither service can drift from the other. REDIS_TELEMETRY_STREAM=telemetry:teltonika # Redis consumer group name. All Processor instances join this group. REDIS_CONSUMER_GROUP=processor # Redis consumer name. Defaults to INSTANCE_ID. # Override only when running multiple instances that should appear as distinct consumers # in the group (e.g. when INSTANCE_ID is not set to a unique value per container). # REDIS_CONSUMER_NAME=processor-1 # Port for Prometheus /metrics, /healthz, /readyz HTTP server. METRICS_PORT=9090 # Max records fetched per XREADGROUP call. BATCH_SIZE=100 # BLOCK timeout (ms) on XREADGROUP when the stream is empty. 0 = no blocking. BATCH_BLOCK_MS=5000 # Max rows per Postgres INSERT batch. WRITE_BATCH_SIZE=50 # Max devices kept in the per-device in-memory state map. LRU eviction beyond this cap. # Size each entry at ~500 bytes → 10 000 devices ≈ 5 MB. Raise for large fleets. DEVICE_STATE_LRU_CAP=10000