The Prompt
“I’m running a SaaS app on Akua (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 Akua 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 | Akua 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 Akua 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
Related topics
Dashboard generation
The full workflow for building live dashboards with an agent.
Database operations
More Postgres, Redis, and chained exec patterns.
Kubernetes access
The exec and kube proxy endpoints behind these widgets.
Code Mode in action
More examples of agents composing complex operations.