# ═══════════════════════════════════════════════════════════
# 🐍 OPHION - OpenTelemetry Collector Service
# Standalone compose file for the OTEL Collector
# ═══════════════════════════════════════════════════════════

version: '3.8'

services:
  otel-collector:
    image: otel/opentelemetry-collector-contrib:0.96.0
    container_name: ophion-otel-collector
    command: ["--config=/etc/otel-collector-config.yaml"]
    volumes:
      - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro
    ports:
      - "4317:4317"   # OTLP gRPC receiver
      - "4318:4318"   # OTLP HTTP receiver
      - "8888:8888"   # Prometheus metrics exposed by the collector
      - "8889:8889"   # Prometheus exporter metrics
      - "13133:13133" # Health check extension
      - "55679:55679" # zPages extension
    environment:
      - OTEL_RESOURCE_ATTRIBUTES=service.name=ophion-collector,service.version=1.0.0
    restart: unless-stopped
    networks:
      - ophion
    healthcheck:
      test: ["CMD", "wget", "-q", "--spider", "http://localhost:13133/health"]
      interval: 10s
      timeout: 5s
      retries: 3
    deploy:
      resources:
        limits:
          memory: 512M
        reservations:
          memory: 128M

networks:
  ophion:
    external: true
