PLGT Stack Troubleshooting Guide
PLGT Stack Troubleshooting Guide
Section titled “PLGT Stack Troubleshooting Guide”Last Updated: 2026-01-05
Quick Diagnostics
Section titled “Quick Diagnostics”# Check all servicesdocker compose ps
# Health check./scripts/health-check.sh
# View recent logsdocker compose logs --tail=50Common Issues
Section titled “Common Issues”Service Won’t Start
Section titled “Service Won’t Start”Diagnosis:
# Check container logsdocker compose logs <service-name>
# Check exit codedocker inspect <container-name> --format='{{.State.ExitCode}}'Exit Codes:
| Code | Meaning | Solution |
|---|---|---|
| 0 | Normal exit | Check if intended |
| 1 | Application error | Check logs for details |
| 137 | Out of memory | Increase memory limit |
| 139 | Segmentation fault | Check configuration |
Prometheus Not Scraping Targets
Section titled “Prometheus Not Scraping Targets”Diagnosis:
- Go to
http://localhost:9090/targets - Check error message for each target
Solutions:
# Verify target is reachabledocker exec prometheus ping target-host
# Test metrics endpointcurl http://target-host:port/metrics# Verify configurationdocker exec prometheus cat /etc/prometheus/prometheus.yml
# Validate configdocker exec prometheus promtool check config /etc/prometheus/prometheus.ymlLoki Not Receiving Logs
Section titled “Loki Not Receiving Logs”Diagnosis:
# Check Alloy statusdocker compose logs alloy
# Verify Loki is readycurl http://localhost:3100/ready
# Check Alloy UI for targets# Open http://localhost:12345 in browserCommon Causes:
# Check log file permissionsls -la /var/log/
# Alloy needs read access to log files# In config.alloy, verify __path__loki.source.file "syslog" { targets = [ {__path__ = "/var/log/syslog", job = "syslog"}, ]}# Check if Alloy can access Docker socketdocker exec alloy ls -la /var/run/docker.sockTempo Not Receiving Traces
Section titled “Tempo Not Receiving Traces”Diagnosis:
# Check Tempo statusdocker compose logs tempo
# Verify Tempo is readycurl http://localhost:3200/ready
# Check if OTLP receiver is listeningcurl http://localhost:3200/statusCommon Causes:
Your application needs OpenTelemetry instrumentation to send traces.
# Verify your app is sending to correct endpoint# OTLP gRPC: tempo:4317# OTLP HTTP: tempo:4318# Check Alloy logs for trace forwardingdocker compose logs alloy | grep -i traceGrafana Dashboard Shows “No Data”
Section titled “Grafana Dashboard Shows “No Data””Diagnosis:
- Go to Configuration → Data sources
- Click Test on each data source
Solutions:
# Verify Prometheus is accessiblecurl http://localhost:9090/api/v1/query?query=up# Verify Loki is accessiblecurl http://localhost:3100/loki/api/v1/labelsdocker compose logs grafanaAlerts Not Firing
Section titled “Alerts Not Firing”Diagnosis:
# Check alert rules in Prometheuscurl http://localhost:9090/api/v1/rules
# Check Alertmanager statuscurl http://localhost:9093/api/v2/statusSolutions:
# Validate rule filedocker exec prometheus promtool check rules /etc/prometheus/rules/alerts.ymlTest query manually in Prometheus UI to verify it returns results
docker compose logs alertmanagerHigh Memory Usage
Section titled “High Memory Usage”Diagnosis:
# Check memory usagedocker stats --no-stream
# Check Prometheus storagecurl http://localhost:9090/api/v1/status/tsdbSolutions:
command: - '--storage.tsdb.retention.time=15d'services: prometheus: deploy: resources: limits: memory: 4GDisk Space Issues
Section titled “Disk Space Issues”Diagnosis:
# Check disk usagedf -h
# Check Docker disk usagedocker system dfSolutions:
# Clean up Dockerdocker system prune -f
# Reduce retention (edit configs)# Then restartdocker compose restartConfiguration Errors
Section titled “Configuration Errors”Validation Commands:
docker exec prometheus promtool check config /etc/prometheus/prometheus.ymldocker exec prometheus promtool check rules /etc/prometheus/rules/alerts.ymldocker exec alertmanager amtool check-config /etc/alertmanager/alertmanager.ymlNetwork Issues
Section titled “Network Issues”Container Cannot Reach Other Containers
Section titled “Container Cannot Reach Other Containers”# Check networkdocker network inspect plg-network
# Test connectivitydocker exec prometheus ping lokidocker exec grafana ping prometheusPort Conflicts
Section titled “Port Conflicts”# Check if port is in usesudo lsof -i :3000sudo lsof -i :9090
# Solution: Stop conflicting service or change portRecovery Procedures
Section titled “Recovery Procedures”Full Stack Recovery
Section titled “Full Stack Recovery”# Stop everythingdocker compose down
# Redeploy./scripts/deploy.sh deployRestore from Backup
Section titled “Restore from Backup”# Stop servicesdocker compose down
# Restore configurationcp -r backups/YYYYMMDD_HHMMSS/* .
# Restartdocker compose up -dReset Grafana Admin Password
Section titled “Reset Grafana Admin Password”docker exec grafana grafana-cli admin reset-admin-password newpasswordDebug Information
Section titled “Debug Information”Collecting Logs for Support
Section titled “Collecting Logs for Support”mkdir -p debug-$(date +%Y%m%d)docker compose ps > debug-$(date +%Y%m%d)/ps.txtdocker compose logs > debug-$(date +%Y%m%d)/logs.txtdocker stats --no-stream > debug-$(date +%Y%m%d)/stats.txt./scripts/health-check.sh > debug-$(date +%Y%m%d)/health.txtLog Locations
Section titled “Log Locations”| Service | Command |
|---|---|
| Prometheus | docker compose logs prometheus |
| Alertmanager | docker compose logs alertmanager |
| Loki | docker compose logs loki |
| Tempo | docker compose logs tempo |
| Alloy | docker compose logs alloy |
| Grafana | docker compose logs grafana |
| Blackbox Exporter | docker compose logs blackbox-exporter |
Client Integration Issues
Section titled “Client Integration Issues”Client Logs Not Appearing in Loki
Section titled “Client Logs Not Appearing in Loki”Diagnosis:
# Check if logs are being pushed from client# On monitoring server, check Loki ingestioncurl -s http://localhost:3100/loki/api/v1/query \ -G --data-urlencode 'query={job="umdoni-activity"}' | jqCommon Causes:
# In loki-config.yml, increase max agelimits_config: reject_old_samples_max_age: 1680h # 70 days unordered_writes: true# Test from client servercurl -v https://monitor.isutech.co.za/loki/api/v1/push// Ensure X-Scope-OrgID header is setcurl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'X-Scope-OrgID: isutech']);Client Metrics Not Scraped
Section titled “Client Metrics Not Scraped”Diagnosis:
# Check Prometheus targetscurl http://localhost:9090/api/v1/targets | jq '.data.activeTargets[] | select(.labels.job=="umdoni-metrics")'Common Causes:
# Test from monitoring servercurl -v "https://umdoni.gov.za/api/metrics.php?token=xxx"# In prometheus.yml, add TLS config- job_name: 'client-metrics' scheme: https tls_config: insecure_skip_verify: true # If neededNext: Query Reference