This project uses a modern observability stack (LGPG: Loki, Grafana, Prometheus, Jaeger) to monitor microservice health, aggregate logs, and trace requests.
| Tool | Purpose | URL | Credentials |
|---|---|---|---|
| Grafana | Data Visualization | http://localhost:3003 | admin / admin |
| Prometheus | Metrics Collection | http://localhost:9090 | None |
| Jaeger | Distributed Tracing | http://localhost:16686 | None |
| Loki | Log Aggregation | Managed via Grafana | None |
- Prometheus: Scrapes
/metricsendpoints from all microservices every 15 seconds. - Loki: A horizontally scalable, highly available, multi-tenant log aggregation system.
- Promtail: An agent which ships local Docker container logs to Loki.
- Jaeger: Provides distributed tracing to help debug performance bottlenecks and request flows across microservices.
- Grafana: The central UI used to query and visualize data from Prometheus, Loki, and Jaeger.
- Symptom: Prometheus targets page shows red for a microservice.
- Action:
- Check if the container is running:
docker-compose ps. - Check container logs for crashes:
docker-compose logs <service-name>. - Ensure the service is correctly exporting metrics at the
:3000/metricspath.
- Check if the container is running:
- Symptom: The Explore tab in Grafana shows no data when selecting the Loki datasource.
- Action:
- Ensure the
promtailcontainer is running. - Check that the path
/var/lib/docker/containersis correctly mounted indocker-compose.yml.
- Ensure the
- Symptom: No traces found for a specific operation.
- Action:
- Verify the
JAEGER_ENDPOINTenvironment variable is correctly set in the microservice configuration. - Check if the service is correctly initialized with the OpenTelemetry/Jaeger SDK.
- Verify the
We use Structured Logging (JSON format) to ensure logs are easily searchable in Loki. Each log should ideally include:
level(info, warn, error)service_namecorrelation_id(for tracing)message