The Prompt
“I’m running a SaaS app on CNAP — Postgres for data, Redis for caching. Create a dashboard that shows me database table sizes, Redis memory, recent app errors from logs, and overall cluster health. I want to open this every morning and know if anything needs attention.”The agent creates four snippets and assembles them into a dashboard.
Widget 1 — Postgres Table Sizes (Table)
The agent uses exec to runpsql inside the Postgres container and query pg_stat_user_tables:
Widget 2 — Redis Memory (Stat)
Runsredis-cli inside the Redis pod and extracts the key metric:
48.23M used / 52.10M peak (frag: 1.12). At a glance: memory is healthy, fragmentation is low.
Widget 3 — Recent App Errors (Logs)
Fetches container logs from the application pod and filters for errors:Widget 4 — Cluster Health (Table)
Queries the CNAP API for cluster status — no exec needed, this is platform data:The Result
Four widgets, one dashboard, auto-refreshes on load:| Widget | Type | Data source | What it shows |
|---|---|---|---|
| Postgres Table Sizes | Table | exec → psql | Top 10 tables with sizes, row counts, vacuum health |
| Redis Memory | Stat | exec → redis-cli | Memory usage, peak, fragmentation ratio |
| Recent App Errors | Logs | Kubernetes log API | Last error lines from each app pod |
| Cluster Health | Table | CNAP API | Cluster status with install health counts |
Why This Matters
This dashboard combines four different data sources — a SQL database, an in-memory cache, container logs, and the CNAP platform API — into a single view. Normally, this means:- Grafana with Prometheus exporters for Redis and Postgres metrics
- A log aggregation pipeline (Loki, ELK) for application errors
- A separate infrastructure dashboard for cluster health
- Hours of configuration, and ongoing maintenance for all of it
Build your own
Read the dashboard generation guide to learn the workflow, then connect your agent and describe the dashboard you want.