services: lgtm: # Grafana's all-in-one OpenTelemetry backend: Loki, Grafana, Tempo, Mimir # (Prometheus), Pyroscope + an OpenTelemetry Collector. # https://github.com/grafana/docker-otel-lgtm image: grafana/otel-lgtm:latest container_name: copilot-lgtm ports: - "3000:3000" # Grafana UI -> http://localhost:3000 (admin/admin) - "4317:4317" # OTLP/gRPC ingest - "4318:4318" # OTLP/HTTP ingest <- VS Code Copilot exports here - "9090:9090" # Prometheus (metrics), optional for debugging - "3200:3200" # Tempo (traces), optional for debugging environment: # Grafana admin credentials (dev only). GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER:-admin} GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD:-admin} # Land on the Overview dashboard when opening Grafana. GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /otel-lgtm/grafana/conf/provisioning/dashboards/custom/copilot-overview.json # Preinstall the Infinity datasource (>= 2.7.1 for backend time macros) so # the Agent Graph and Agent Timeline dashboards can read the agent-insights # sidecar. SYNC installs before Grafana starts, so provisioning finds the # plugin. Needs outbound internet on first start to download the plugin. GF_PLUGINS_PREINSTALL_SYNC: yesoreyeram-infinity-datasource volumes: # Provider config that tells Grafana where to find our custom dashboards. - ./grafana/provisioning/dashboards/copilot.yaml:/otel-lgtm/grafana/conf/provisioning/dashboards/copilot.yaml:ro # All dashboard JSON files in this folder are auto-loaded on startup. - ./grafana/dashboards:/otel-lgtm/grafana/conf/provisioning/dashboards/custom:ro # Infinity datasource used by the Agent Graph Node Graph panel. - ./grafana/provisioning/datasources/infinity.yaml:/otel-lgtm/grafana/conf/provisioning/datasources/infinity.yaml:ro # Custom OTel Collector config that computes gen_ai.usage.cost_usd on spans. - ./otelcol/otelcol-config.yaml:/otel-lgtm/otelcol-config.yaml:ro # Persist metrics/traces/logs across container restarts (dev convenience). - lgtm-data:/data healthcheck: # The image writes /tmp/ready once every backend is up. test: ["CMD-SHELL", "test -f /tmp/ready || exit 1"] interval: 30s timeout: 5s retries: 5 start_period: 90s agent-insights: # Trace-derived views sidecar: walks Tempo traces and serves aggregated JSON # frames that no LGTM datasource can produce directly — the parent-agent -> # subagent graph, per-conversation timelines, and cost by repo/branch. # Consumed by the Agent Graph, Agent Timeline, and Cost by Repo & Branch # dashboards via the Infinity datasource. build: ./agent-insights container_name: copilot-agent-insights environment: # Reach Tempo on the shared compose network via the lgtm service name. TEMPO_URL: http://lgtm:3200 PORT: "8099" ports: - "8099:8099" # JSON views + /health, optional for debugging depends_on: - lgtm restart: unless-stopped volumes: lgtm-data: