Monitoring Setup
هذا المحتوى غير متوفر بلغتك بعد.
Guide: Monitoring Setup
Section titled “Guide: Monitoring Setup”ɳSelf’s monitoring stack provides metrics, logs, and alerting for your entire backend.
Install the Monitoring Plugin
Section titled “Install the Monitoring Plugin”nself plugin install monitoringnself build && nself restartThis adds 10 services to your stack:
| Service | Purpose |
|---|---|
| Prometheus | Metrics collection and storage |
| Grafana | Metrics dashboards |
| Loki | Log aggregation |
| Promtail | Log shipping agent |
| Tempo | Distributed tracing |
| Alertmanager | Alert routing and notifications |
| cAdvisor | Container resource metrics |
| Node Exporter | Host OS metrics |
| Postgres Exporter | Database metrics |
| Redis Exporter | Redis metrics (if Redis enabled) |
Access Grafana
Section titled “Access Grafana”nself urls # shows Grafana URL and default credentialsDefault credentials are in .env as GRAFANA_USER / GRAFANA_PASSWORD. Change them immediately.
Pre-Built Dashboards
Section titled “Pre-Built Dashboards”Grafana comes pre-loaded with dashboards for:
- Container metrics: CPU, memory, network per container (cAdvisor)
- Host metrics: disk, CPU, memory, load (Node Exporter)
- PostgreSQL: connections, query rates, cache hit ratio (Postgres Exporter)
- Nginx: request rates, error rates, response times
Log Aggregation with Loki
Section titled “Log Aggregation with Loki”All container logs are shipped to Loki via Promtail. Query logs in Grafana using LogQL:
{container="myproject_hasura_1"} |= "error"Setting Up Alerts
Section titled “Setting Up Alerts”Edit monitoring/alertmanager/config.yml to configure notification channels:
receivers: - name: 'slack' slack_configs: - api_url: 'https://hooks.slack.com/services/...' channel: '#alerts'Pre-built alert rules cover:
- Container down
- High CPU / memory usage
- Postgres connection exhaustion
- Disk space low
See Also
Section titled “See Also”- Guide-Production-Deployment: initial server setup
- plugin-monitoring: monitoring plugin reference
- Feature-Monitoring: monitoring feature overview