# Vector config: docker logs → Axiom logs dataset # Redis prometheus metrics → Axiom metrics dataset # Enable Vector's API server so the container's healthcheck can hit # /health. Bound to localhost only — never exposed outside the container. [api] enabled = true address = "127.0.0.1:8686" # ───────────────────────────────────────────────────────────────────── # LOGS pipeline # ───────────────────────────────────────────────────────────────────── [sources.docker] type = "docker_logs" include_containers = ["spoo_app", "spoo_qr", "spoo_click_worker", "spoo_next"] exclude_containers = ["spoo_vector", "spoo_redis_exporter"] [transforms.parse_and_clean] type = "remap" inputs = ["docker"] # Tag service name + lift structlog JSON without dropping bad events. # parse_json !! null falls back to null on error (no panic). source = ''' .service = .container_name if .container_name == "spoo_app" || .container_name == "spoo_qr" || .container_name == "spoo_click_worker" { parsed = parse_json(.message) ?? null if parsed != null && is_object(parsed) { . = merge(., object!(parsed)) del(.message) } } # Strip docker-injected metadata noise (kept the event no matter what). del(.label) del(.image) del(.host) del(.container_id) del(.container_created_at) del(.source_type) del(.stream) ''' [transforms.drop_health] type = "filter" inputs = ["parse_and_clean"] condition = ''' !(exists(.http_path) && .http_path == "/health") ''' [sinks.axiom_logs] type = "axiom" inputs = ["drop_health"] token = "${AXIOM_TOKEN}" dataset = "${AXIOM_DATASET}" [sinks.axiom_logs.healthcheck] enabled = true # ───────────────────────────────────────────────────────────────────── # REDIS METRICS pipeline (scrape redis-exporter every 15s, ship to Axiom) # ───────────────────────────────────────────────────────────────────── [sources.redis_metrics] type = "prometheus_scrape" endpoints = ["http://redis-exporter:9121/metrics"] scrape_interval_secs = 15 [transforms.metrics_to_log] type = "metric_to_log" inputs = ["redis_metrics"] host_tag = "host" [transforms.tag_metrics] type = "remap" inputs = ["metrics_to_log"] source = ''' .service = "redis" .source_kind = "metrics" ''' [sinks.axiom_metrics] type = "axiom" inputs = ["tag_metrics"] token = "${AXIOM_TOKEN}" dataset = "${AXIOM_METRICS_DATASET}" [sinks.axiom_metrics.healthcheck] enabled = true