This document outlines the logging architecture and provides the necessary LogQL queries for Grafana.
This query calculates the percentage of logs with level="ERROR" relative to total logs.
sum(rate({container="mobilemoney_app"} | json | level="ERROR" [5m]))
/
sum(rate({container="mobilemoney_app"} [5m]))
* 100
This query calculates the 99th percentile of response latency.
Note: Requires logging duration or responseTime in the JSON payload.
quantile_over_time(0.99, {container="mobilemoney_app"} | json | unwrap duration [5m])
Monitor custom "SECURITY" level logs.
{container="mobilemoney_app"} | json | level="SECURITY"
Monitor custom "AUDIT" level logs.
{container="mobilemoney_app"} | json | level="AUDIT"
-
Start the Stack:
docker-compose up -d
-
Access Grafana:
- URL:
http://localhost:3001 - User:
admin/admin
- URL:
-
Configure Data Source:
- Add Loki as a data source.
- URL:
http://loki:3100
-
Verify CI/CD Integrity:
bash scripts/verify-logging.sh