@galdor/dashboard 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @galdor/dashboard
|
|
2
|
+
|
|
3
|
+
The embedded observability dashboard for
|
|
4
|
+
[galdor](https://github.com/YasserCR/galdor-bun). Serves a web UI and JSON/SSE
|
|
5
|
+
API over a galdor span store (`traces.db`): a run list with live tail, per-run
|
|
6
|
+
timeline + span tree + rendered execution graph, span detail, and standalone
|
|
7
|
+
graph rendering.
|
|
8
|
+
|
|
9
|
+
Runs on `Bun.serve` or as a plain `fetch` handler you can mount in any runtime.
|
|
10
|
+
Includes a Host-header allowlist (anti DNS-rebinding), body/node caps on graph
|
|
11
|
+
rendering, and light/dark themes.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun add @galdor/dashboard # or: npm install @galdor/dashboard
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { startDashboard } from "@galdor/dashboard";
|
|
23
|
+
import { Store } from "@galdor/core/store";
|
|
24
|
+
|
|
25
|
+
const store = Store.openExisting("traces.db"); // written by @galdor/core observability
|
|
26
|
+
const server = startDashboard({ store, port: 7777 });
|
|
27
|
+
await server.ready;
|
|
28
|
+
console.log(`dashboard on http://127.0.0.1:${server.port}`);
|
|
29
|
+
// server.stop(true) to shut down
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Mount the request handler in your own server instead:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { createHandler } from "@galdor/dashboard";
|
|
36
|
+
|
|
37
|
+
const handler = createHandler(store, { allowedHosts: ["dash.internal"] });
|
|
38
|
+
const res = await handler(new Request("http://127.0.0.1/api/runs"));
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Routes
|
|
42
|
+
|
|
43
|
+
- `/` — run list (live-tail via SSE); `?limit=N`
|
|
44
|
+
- `/runs/:id` — run detail (timeline, span tree, graph); `/runs/:id/steps`
|
|
45
|
+
- `/graph` — standalone graph explorer; `?run=<id>` server-renders a run's topology
|
|
46
|
+
- `/api/runs`, `/api/runs/:id/spans`, `/api/runs/:id/graph[/model|/svg]`, `/api/orphans`
|
|
47
|
+
- `POST /api/graph/svg` — render an arbitrary spec (1 MiB / 2000-node caps)
|
|
48
|
+
- `/events` — SSE live tail (`?interval=`, heartbeats); `/healthz`
|
|
49
|
+
|
|
50
|
+
Populate the store with `setupTracing` from
|
|
51
|
+
[`@galdor/core`](https://www.npmjs.com/package/@galdor/core), or via the
|
|
52
|
+
`galdor` CLI (`galdor ui`).
|
|
53
|
+
|
|
54
|
+
## License
|
|
55
|
+
|
|
56
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galdor/dashboard",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Embedded observability dashboard for galdor-bun (Bun.serve).",
|
|
6
6
|
"author": {
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
"bun": ">=1.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@galdor/core": "0.3.
|
|
34
|
+
"@galdor/core": "0.3.1"
|
|
35
35
|
}
|
|
36
36
|
}
|