cookbook / grafana
Grafana
A dashboard the agent can point at its own data, instead of a STATUS.md it writes by hand.
- app
- observability
Run it
briq_run({
recipe: "grafana",
params: {
"size": "nano"
},
wait: true
})briq run grafana
briq ls
briq logs -f <id>
briq rm <id>import { Briq } from '@briq/sdk';
const briq = new Briq(process.env.BRIQ_API_KEY);
const grafana = await briq.run({
recipe: 'grafana',
params: {
"size": "nano"
},
});
console.log(grafana.outputs.GRAFANA_URL);
// ... when done
await briq.destroy(grafana.id);Parameters
| Name | Type | Options | Default |
|---|---|---|---|
| size | enum | nano, small, medium | "nano" |
Outputs
Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.
- GRAFANA_URL
- http://grafana.<stack>.internal:3000
- GRAFANA_ADMIN_USER
- admin
- GRAFANA_ADMIN_PASSWORD
- <GRAFANA_ADMIN_PASSWORD>
What it runs
| Briq | Image | Ports | Size | Volume |
|---|---|---|---|---|
| grafana | grafana/grafana:latest | 3000 | nano | 5 GB at /var/lib/grafana |
When to use it
- The agent keeps writing a STATUS.md or METRICS.md by hand after a load test or a long run, and you would rather look at a chart than a paragraph of numbers.
- You want a dashboard you can point at data the agent's own briqs are already producing — Postgres query stats, a Prometheus endpoint a service exposes, logs — instead of a snapshot frozen into a file.
- You want to hand a teammate a link to a live dashboard, not a note that goes stale the moment the agent stops updating it.
The volume is 5 GB, mounted at /var/lib/grafana, so a stopped briq keeps its dashboards and
data source configuration.
Tips
- Add data sources through the API, not the UI, so the agent can wire it up itself:
POST /api/datasourcesagainstGRAFANA_URLwith basic auth fromGRAFANA_ADMIN_USERandGRAFANA_ADMIN_PASSWORD. - Point it at another briq in the stack. A Postgres or Prometheus-compatible service in the same run is reachable at its internal host; Grafana does not need its data source exposed publicly, only itself.
- Provision dashboards as JSON.
POST /api/dashboards/dbwith a dashboard model is faster and more repeatable than building panels by hand for something the agent generates each run. - Share the view, not a screenshot.
briq_exposeport 3000 withmode: "token"and hand the URL to whoever asked for the status update.