hyperdx/docker
Zeynel 4c2c3f37c6
feat: Add file-based dashboard provisioner (#1962)
## Summary

Add a `provision-dashboards` task that reads `.json` files from a directory and upserts dashboards into MongoDB, following the existing task system pattern (same as `check-alerts`).

Provisioned dashboards are flagged with `provisioned: true` so they never overwrite user-created dashboards with the same name. Files are validated against `DashboardWithoutIdSchema`. Removing a file does not delete the dashboard (safe by default, same as Grafana). The task is deployment-agnostic: it reads from a directory, regardless of how files get there.

When `DASHBOARD_PROVISIONER_DIR` is set, `entry.prod.sh` automatically starts the task as an additional process alongside the API, App, and check-alerts.

**Note:** Users can currently edit provisioned dashboards through the UI, but changes will be overwritten on the next sync cycle. Grafana handles this by blocking saves on provisioned dashboards. Adding a similar guard would be a good follow-up to improve UX.

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `DASHBOARD_PROVISIONER_DIR` | Yes |  | Directory to read `.json` files from |
| `DASHBOARD_PROVISIONER_TEAM_ID` | No* |  | Scope to a specific team ID |
| `DASHBOARD_PROVISIONER_ALL_TEAMS` | No* | `false` | Set to `true` to provision to all teams |

\*One of `DASHBOARD_PROVISIONER_TEAM_ID` or `DASHBOARD_PROVISIONER_ALL_TEAMS=true` is required.

### How to test locally or on Vercel

1. Create a directory with a dashboard JSON file:
   ```bash
   mkdir /tmp/dashboards
   echo '{"name":"Test Dashboard","tiles":[],"tags":[]}' > /tmp/dashboards/test.json
2. Run the task:
DASHBOARD_PROVISIONER_DIR=/tmp/dashboards DASHBOARD_PROVISIONER_ALL_TEAMS=true \
  ./packages/api/bin/hyperdx task provision-dashboards
3. Verify the dashboard appears in the UI
4. Modify the JSON file, run again, verify it updates
5. Delete the JSON file, run again, verify the dashboard persists

References

- Related PRs: https://github.com/ClickHouse/ClickStack-helm-charts/pull/190
2026-05-19 14:48:06 +00:00
..
clickhouse/local feat: optimized default otel-logs schema (#2125) 2026-05-05 16:23:08 +00:00
hostmetrics fix: Set correct github URL as image source in Dockerfiles (#1698) 2026-02-04 16:11:31 +00:00
hyperdx feat: Add file-based dashboard provisioner (#1962) 2026-05-19 14:48:06 +00:00
nginx feat: add example nginx ssl reverse proxy service (#535) 2024-12-17 18:29:54 +00:00
otel-collector feat: fast and full autocomplete (#2128) 2026-05-08 20:38:12 +00:00