Skip to content

PLGT Stack Troubleshooting Guide

Last Updated: 2026-01-05


Terminal window
# Check all services
docker compose ps
# Health check
./scripts/health-check.sh
# View recent logs
docker compose logs --tail=50

Diagnosis:

Terminal window
# Check container logs
docker compose logs <service-name>
# Check exit code
docker inspect <container-name> --format='{{.State.ExitCode}}'

Exit Codes:

CodeMeaningSolution
0Normal exitCheck if intended
1Application errorCheck logs for details
137Out of memoryIncrease memory limit
139Segmentation faultCheck configuration

Diagnosis:

  1. Go to http://localhost:9090/targets
  2. Check error message for each target

Solutions:

Terminal window
# Verify target is reachable
docker exec prometheus ping target-host
# Test metrics endpoint
curl http://target-host:port/metrics

Diagnosis:

Terminal window
# Check Alloy status
docker compose logs alloy
# Verify Loki is ready
curl http://localhost:3100/ready
# Check Alloy UI for targets
# Open http://localhost:12345 in browser

Common Causes:

Terminal window
# Check log file permissions
ls -la /var/log/
# Alloy needs read access to log files

Diagnosis:

Terminal window
# Check Tempo status
docker compose logs tempo
# Verify Tempo is ready
curl http://localhost:3200/ready
# Check if OTLP receiver is listening
curl http://localhost:3200/status

Common Causes:

Your application needs OpenTelemetry instrumentation to send traces.


Diagnosis:

  1. Go to ConfigurationData sources
  2. Click Test on each data source

Solutions:

Terminal window
# Verify Prometheus is accessible
curl http://localhost:9090/api/v1/query?query=up

Diagnosis:

Terminal window
# Check alert rules in Prometheus
curl http://localhost:9090/api/v1/rules
# Check Alertmanager status
curl http://localhost:9093/api/v2/status

Solutions:

Terminal window
# Validate rule file
docker exec prometheus promtool check rules /etc/prometheus/rules/alerts.yml

Diagnosis:

Terminal window
# Check memory usage
docker stats --no-stream
# Check Prometheus storage
curl http://localhost:9090/api/v1/status/tsdb

Solutions:

docker-compose.yml
command:
- '--storage.tsdb.retention.time=15d'

Diagnosis:

Terminal window
# Check disk usage
df -h
# Check Docker disk usage
docker system df

Solutions:

Terminal window
# Clean up Docker
docker system prune -f
# Reduce retention (edit configs)
# Then restart
docker compose restart

Validation Commands:

Terminal window
docker exec prometheus promtool check config /etc/prometheus/prometheus.yml

Terminal window
# Check network
docker network inspect plg-network
# Test connectivity
docker exec prometheus ping loki
docker exec grafana ping prometheus
Terminal window
# Check if port is in use
sudo lsof -i :3000
sudo lsof -i :9090
# Solution: Stop conflicting service or change port

Terminal window
# Stop everything
docker compose down
# Redeploy
./scripts/deploy.sh deploy
Terminal window
# Stop services
docker compose down
# Restore configuration
cp -r backups/YYYYMMDD_HHMMSS/* .
# Restart
docker compose up -d
Terminal window
docker exec grafana grafana-cli admin reset-admin-password newpassword

Terminal window
mkdir -p debug-$(date +%Y%m%d)
docker compose ps > debug-$(date +%Y%m%d)/ps.txt
docker compose logs > debug-$(date +%Y%m%d)/logs.txt
docker stats --no-stream > debug-$(date +%Y%m%d)/stats.txt
./scripts/health-check.sh > debug-$(date +%Y%m%d)/health.txt
ServiceCommand
Prometheusdocker compose logs prometheus
Alertmanagerdocker compose logs alertmanager
Lokidocker compose logs loki
Tempodocker compose logs tempo
Alloydocker compose logs alloy
Grafanadocker compose logs grafana
Blackbox Exporterdocker compose logs blackbox-exporter

Diagnosis:

Terminal window
# Check if logs are being pushed from client
# On monitoring server, check Loki ingestion
curl -s http://localhost:3100/loki/api/v1/query \
-G --data-urlencode 'query={job="umdoni-activity"}' | jq

Common Causes:

# In loki-config.yml, increase max age
limits_config:
reject_old_samples_max_age: 1680h # 70 days
unordered_writes: true

Diagnosis:

Terminal window
# Check Prometheus targets
curl http://localhost:9090/api/v1/targets | jq '.data.activeTargets[] | select(.labels.job=="umdoni-metrics")'

Common Causes:

Terminal window
# Test from monitoring server
curl -v "https://umdoni.gov.za/api/metrics.php?token=xxx"

Next: Query Reference