No Metrics Showing

Diagnose why metrics aren't appearing after the agent connects.

If your agent shows as Connected in the dashboard but no metrics appear (no containers, no CPU/memory data), work through these checks.

Check 1: Wait 30 seconds

The agent pushes metrics every 15 seconds. After first connecting, it can take up to 30 seconds for the first metrics to appear in the dashboard. If you just deployed the agent, wait a moment and refresh.

Check 2: Check agent push logs

Look for push success/failure messages in the agent logs:

Docker:

docker logs kubewatch-agent --tail=20

Kubernetes:

kubectl logs -n kubewatch -l app=kubewatch-agent --tail=20

Healthy output:

INFO  push ok, containers=8 nodes=0 pods=0
INFO  push ok, containers=8 nodes=0 pods=0

Problem indicators:

WARN  push failed: 502 Bad Gateway
WARN  push failed: context deadline exceeded
ERROR docker socket read error: permission denied

Check 3: Docker socket permissions

If you see permission denied when reading the Docker socket, the agent container doesn't have access to /var/run/docker.sock.

Verify the socket exists and has group-readable permissions:

ls -la /var/run/docker.sock
# Expected: srw-rw---- 1 root docker ...

If you're running the agent with a non-root user, add it to the docker group, or run the container with --user root.

For Docker Compose, ensure the volume mount is present:

volumes:
  - /var/run/docker.sock:/var/run/docker.sock:ro

Check 4: Kubernetes RBAC (Kubernetes agents only)

For Kubernetes agents, verify the ClusterRole and ClusterRoleBinding were created by the Helm chart:

kubectl get clusterrole kubewatch-agent
kubectl get clusterrolebinding kubewatch-agent

If they don't exist, the agent can't read pod and node data from the Kubernetes API. Reinstall the Helm chart:

helm upgrade --install kubewatch-agent kubewatch/kubewatch-agent \
  --namespace kubewatch \
  --set agent.apiKey=YOUR_API_KEY \
  --set agent.gatewayURL=https://YOUR_KUBEWATCH_URL

Check 5: Correct agent selected in dashboard

Make sure you're viewing the right agent in the dashboard. Check the agent selector in the top bar, if it's set to a different agent, you won't see metrics from your newly deployed agent. Set it to All agents or select the specific agent by name.

Check 6: Ingestion service health (self-hosted only)

If you're running self-hosted KubeWatch and push requests return 502, the ingestion service may be down:

cd /opt/kubewatch
docker compose ps ingestion
docker compose logs ingestion --tail=30

Restart if needed:

docker compose restart ingestion

Check 7: Database connection (self-hosted only)

If the ingestion service is crashing on startup, it may be unable to connect to the database:

docker compose logs ingestion | grep -i "database\|postgres\|connection"

Verify the PostgreSQL container is healthy:

docker compose ps postgres