Monitoring & Observability¶
PLift includes a complete observability stack with metrics, logs, and distributed tracing.
Metrics Collection¶
Prometheus automatically discovers and scrapes metrics from:
- All application containers (via
/metricsendpoints) - cAdvisor (container metrics)
- Prometheus itself
Framework Metrics Endpoints¶
| Framework | Endpoint |
|---|---|
| Laravel | /metrics (custom implementation) |
| Django | /metrics (prometheus-client) |
| Node.js | /metrics (prom-client) |
| Java | /actuator/prometheus (Spring Boot Actuator) |
Logging¶
Loki aggregates logs from all containers:
- Collects stdout/stderr from Docker containers
- Queryable via Grafana
- LogQL query language support
Alloy collects container logs via Docker socket and forwards to Loki.
Distributed Tracing¶
Tempo or Jaeger collect distributed traces:
- OpenTelemetry integration for all frameworks
- Automatic instrumentation for Java (via Java agent)
- Manual instrumentation examples for other frameworks
- Trace correlation with logs and metrics in Grafana
Grafana Dashboards¶
Pre-configured dashboards are automatically generated:
Application Metrics Dashboard¶
- Request rates, latency, error rates
- Database query metrics
- Container resource usage
Application Logs Dashboard¶
- Log aggregation and filtering
- Log level distribution
- Error log highlighting
Application Traces Dashboard¶
- Service map visualization
- Trace timeline
- Span details and performance
Dashboard Management¶
# Import dashboards (if file provisioning doesn't work)
./scripts/import-grafana-dashboards.sh
# Reset dashboards
./scripts/reset-dashboards.sh
Traffic Generation¶
Generate test traffic to populate metrics, logs, and traces:
# Generate 10 requests to each app (default)
plift generate-traffic
# Generate custom number of requests
plift generate-traffic requests=50
# Use HTTP instead of HTTPS
plift generate-traffic requests=20 http
The script:
- Discovers all configured apps from hosts file
- Checks app availability
- Generates requests to
/testendpoints - Reports success/error rates
- Populates monitoring stack with data
Accessing Monitoring Tools¶
| Tool | URL | Credentials |
|---|---|---|
| Grafana | https://grafana.plift.local |
admin/admin |
| Prometheus | https://prometheus.plift.local |
- |
| Tempo | https://tempo.plift.local |
- |
| Loki | https://loki.plift.local |
- |
| Jaeger | https://jaeger.plift.local |
- |
| cAdvisor | https://cadvisor.plift.local |
- |
| Alloy | https://alloy.plift.local |
- |