Monitor your instance
Monitor the instance in Grafana and Tower, centralize its logs, and define their retention.
In brief
Grafana brings metrics and logs together, Tower controls the instance, and Ntfy pushes alerts. You centralize technical traces, choose their retention, and prepare their export off-instance.
On this page, <instance> is global.instanceName or, when that value is empty, the Helm release name; <namespace> is the configured namespace, whose chart default is misty.
Review metrics and logs
Brume installs kube-prometheus-stack on the cluster, complements collection with Loki and Promtail, and exposes a dedicated control console.
Web consoles can be protected by your upstream access control. Cloudflare Access is one example, not a product prerequisite; any equivalent upstream access control works.
| Component | Role | Access |
|---|---|---|
| Prometheus | Collects system, database, and application metrics | Internal to the cluster |
| Promtail | Aggregates pod output | Internal to the cluster |
| Loki | Indexes logs by service, level, and time window | Grafana Explore |
| Grafana | Real-time dashboards | grafana.<your-domain>, behind your upstream access control |
| Alertmanager | Routes alerts to Ntfy | Internal, mobile push through Ntfy |
| Tower | Control console (pod state, backups, scale) | tower.<your-domain>, optional upstream protection |
critical alerts repeat every 30 min and warning alerts every 4 h. CloudNativePG's PodMonitor collects PostgreSQL metrics.
Mandatory Grafana setting
With multiple replicas, the Grafana IngressRoute must preserve a sticky session or the browser loops after sign-in. The chart configures the grafana_sticky cookie on grafana.<your-domain>; verify it after changing the monitoring ingress.
Quick diagnostics
Four commands provide the overall health state in less than a minute.
| Check | Command |
|---|---|
| Application pod state | kubectl get pods -n <namespace> |
| PostgreSQL cluster state | kubectl get cluster -n <namespace> |
| PostgreSQL details (primary, replication lag) | kubectl cnpg status <instance>-pg -n <namespace> |
| CPU/memory load | kubectl top nodes then kubectl top pods -n <namespace> |
To go further on a component:
# Service logs
kubectl logs deployment/<instance>-backend -n <namespace> --tail=100
# Recent namespace events
kubectl get events -n <namespace> --sort-by='.lastTimestamp' | tail -20
# Active Alertmanager alerts
kubectl port-forward svc/monitoring-alertmanager -n monitoring 9093:9093
curl -s http://localhost:9093/api/v2/alerts | jqTrack file indexing
Indexing uses Procrastinate tasks stored in PostgreSQL. If it slows down, review their state in SQL.
-- Active or pending tasks
SELECT id, task_name, status, attempts, queue_name, scheduled_at
FROM procrastinate_jobs
WHERE status IN ('todo', 'doing')
ORDER BY id DESC
LIMIT 50;
-- Failed tasks in the last 24 hours
SELECT id, task_name, attempts, args
FROM procrastinate_jobs
WHERE status = 'failed' AND scheduled_at > now() - interval '1 day'
ORDER BY id DESC;Backlog in processing indicates insufficient compute; in embedding, check the provider and its key. For repeated failures, read task_name and attempts.
Centralize audit logs
| Channel | Collection | Scope |
|---|---|---|
| Application audit | Tamper-evident append-only PostgreSQL log and brume.audit.v1 stdout projection | Authentication, members, workspaces, settings, and instrumented HTTP egress |
| PostgreSQL access | pgAudit in the PostgreSQL log | Separate operator channel to ship off-host |
| Kubernetes access | API server audit log | Enable on dedicated infrastructure; disabled by default in shared mode |
| Hardened egress | Smokescreen decisions normalized as network.egress events | Pods covered by the NetworkPolicy |
The in-application console is covered under Review the audit log. To process fields, use the audit event contract.
Export logs to a SIEM
Enterprise transports carry the canonical brume.audit.export.v1 document through a signed webhook, Splunk HEC, or TLS syslog. The pull API and S3 export also cover replay and batch archives. Apply the SIEM recipes without changing the schema by transport.
Define log retention
| Data | Retention |
|---|---|
| Visible application audit-log window | 30 days; this window is not a promise of physical deletion at day 30 |
| Application logs in Loki | Sliding window configurable by environment |
| Resolved alerts in Tower | 30 days, automatic purge |
| Tower snapshots | 7 days, automatic purge |
Set retention, access rights, alerts, and reviews for your context. These traces contribute evidence for NIS2, ANSSI PA-022, ISO/IEC 27001 A.8.15, and SOC 2 CC7.x controls; they do not certify your organization.
Control the instance in Tower
Tower (tower.<your-domain>) shows pods, CNPG backups, and deployments. You can protect this access with the upstream access control of your choice.
Monitor. A CronJob checks the instance every 2 minutes and alerts through Ntfy.
Purge. A daily CronJob keeps 7 days of metrics and 30 days of resolved alerts.
Act. The service account reads cluster state; its writes are limited to scaling and backups.
Three channels for the same state
Grafana analyzes history, Tower acts on the instance, and Ntfy notifies. To find the cause, open Troubleshooting.