@@ -163,6 +163,64 @@ services:
163163For more complex configurations, you can use environment files or Docker secrets
164164to manage these values.
165165
166+ ## Dashboard Provisioning
167+
168+ HyperDX supports file-based dashboard provisioning, similar to Grafana's
169+ provisioning system. A scheduled task reads ` .json` files from a directory
170+ and upserts dashboards into MongoDB, matched by name for idempotency.
171+ The task runs on the same schedule as other HyperDX tasks (every minute
172+ when using the built-in scheduler, or on your own schedule when running
173+ tasks externally).
174+
175+ # ## Environment Variables
176+
177+ | Variable | Required | Default | Description |
178+ | ----------------------------------- | -------- | ------- | --------------------------------------------------------------- |
179+ | `DASHBOARD_PROVISIONER_DIR` | Yes | | Directory to watch for `.json` dashboard files |
180+ | `DASHBOARD_PROVISIONER_TEAM_ID` | No\* | | Scope provisioning to a specific team ID |
181+ | `DASHBOARD_PROVISIONER_ALL_TEAMS` | No\* | `false` | Set to `true` to provision dashboards to all teams |
182+
183+ \*One of `DASHBOARD_PROVISIONER_TEAM_ID` or `DASHBOARD_PROVISIONER_ALL_TEAMS=true`
184+ is required when `DASHBOARD_PROVISIONER_DIR` is set.
185+
186+ # ## Dashboard JSON Format
187+
188+ Each `.json` file in the provisioner directory should contain a dashboard object
189+ with at minimum a `name` and `tiles` array :
190+
191+ ` ` ` json
192+ {
193+ "name": "My Dashboard",
194+ "tiles": [
195+ {
196+ "id": "tile-1",
197+ "x": 0,
198+ "y": 0,
199+ "w": 6,
200+ "h": 4,
201+ "config": {
202+ "name": "Request Count",
203+ "source": "Metrics",
204+ "displayType": "line",
205+ "select": [{ "aggFn": "count" }]
206+ }
207+ }
208+ ],
209+ "tags": ["provisioned"]
210+ }
211+ ` ` `
212+
213+ # ## Behavior
214+
215+ - Dashboards are matched by name and team for idempotency
216+ - Provisioned dashboards are flagged with `provisioned : true` so they never
217+ overwrite user-created dashboards with the same name
218+ - Removing a file from the directory does **not** delete the dashboard from
219+ MongoDB (safe by default)
220+ - Files are validated against the `DashboardWithoutIdSchema` Zod schema; invalid
221+ files are skipped with a warning
222+
223+
166224# # Note on Security
167225
168226While this feature is convenient for development and initial setup, be careful
0 commit comments