Dieses Verzeichnis bringt ein self-hosted Ops-Monitoring (Metriken/Logs/Traces) und passt als Basis fuer Agent-Monitoring.
- OpenTelemetry Collector
- Prometheus (Metrics)
- Grafana (Dashboards)
- Tempo (Traces)
- Loki (Logs)
cd Monitoring
docker compose up -dGrafana: http://localhost:3000 (admin / admin) Prometheus: http://localhost:9090 Tempo: http://localhost:3200 Loki: http://localhost:3100
Der Monitoring-Stack ist in deployment-mac.yaml integriert und umfasst:
- OTel Collector (OTLP, Prometheus Export)
- Prometheus, Grafana, Tempo, Loki
- Promtail (DaemonSet) fuer Pod-Logs
Start im Cluster:
kubectl apply -f deployment-mac.yamlDie lokalen Port-Forwards werden von starter.sh gesetzt. Aktuelle Ports:
- Grafana: http://localhost:3001
- Prometheus: http://localhost:9090
- Tempo: http://localhost:3200
- Loki: http://localhost:3101
- OTel Collector Metrics: http://localhost:8889/metrics
Ein Dashboard wird automatisch provisioniert: "Agent Monitoring".
Abgedeckte Metriken:
- agent_create_total
- agent_active_count
- agent_jobs_total
- agent_job_duration_ms_bucket (p95)
- agent_mcp_request_duration_ms_bucket (p95)
- agent_handoff_enqueued_total
- agent_spawned_children_total
Der Agent-API-Service stellt seine Prometheus-Metriken jetzt direkt auf
/metrics bereit und wird von Prometheus unter dem Job agent-api gescrapt.
Promtail laeuft als DaemonSet und shippt Pod-Logs nach Loki. In der
Default-Config wird der Pfad /var/log/pods/*/*/*.log gescraped.
In Loki sind mindestens die filename Labels verfuegbar.
Setze in Agent-API und Worker folgende Umgebungsvariablen:
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_RESOURCE_ATTRIBUTES=service.name=agent-worker,service.version=dev
Fuer die Agent-API entsprechend service.name=agent-api.