You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(agentsight): add AgentSight Dashboard web UI (#74)
Close#74
Introduce a React-based web Dashboard to provide an interactive
visualization interface for AgentSight:
- Add dashboard/ frontend source under src/agentsight/dashboard/ with
webpack embed output path set to ../frontend-dist
- Add Makefile targets build-frontend and build-all for one-step
frontend + Rust builds
- Update README / README_CN with agentsight serve command usage,
two scenarios (live tracing vs. historical data browsing), and
remote server access guide
Signed-off-by: liyuqing <liyuqing@alibaba-inc.com>
Start the HTTP API server and serve the embedded Dashboard UI.
123
+
124
+
```bash
125
+
# Start with default settings (binds to 127.0.0.1:7396)
126
+
agentsight serve
127
+
128
+
# Bind to all interfaces on a custom port
129
+
agentsight serve --host 0.0.0.0 --port 8080
130
+
131
+
# Point to a specific database file
132
+
agentsight serve --db /path/to/genai_events.db
133
+
```
134
+
120
135
### `agentsight discover`
121
136
122
137
Discover AI agents running on the system.
@@ -132,6 +147,68 @@ agentsight discover --list
132
147
agentsight discover --verbose
133
148
```
134
149
150
+
## Dashboard
151
+
152
+
The Dashboard is a React-based web UI for visualizing conversation history, trace details, and token statistics. It is embedded into the `agentsight serve` binary at compile time.
153
+
154
+
### Build the Dashboard
155
+
156
+
```bash
157
+
cd src/agentsight
158
+
159
+
# Build frontend and embed into frontend-dist/ (required before cargo build)
160
+
make build-frontend
161
+
162
+
# Then build the Rust binary with the embedded UI
163
+
make build
164
+
165
+
# Or do both in one step
166
+
make build-all
167
+
```
168
+
169
+
### Scenario 1 — Collect data and view the Dashboard simultaneously
170
+
171
+
Run the tracer and the API server in two separate terminals:
172
+
173
+
```bash
174
+
# Terminal 1: start eBPF tracing (writes to SQLite)
175
+
sudo agentsight trace
176
+
177
+
# Terminal 2: start the API server (reads from the same SQLite)
178
+
agentsight serve
179
+
```
180
+
181
+
Open `http://127.0.0.1:7396` in your browser. The Dashboard auto-refreshes as new data arrives.
182
+
183
+
> **Running on a remote server?** Bind to all interfaces and access via the server's public IP:
184
+
> ```bash
185
+
> agentsight serve --host 0.0.0.0 --port 7396
186
+
>```
187
+
> Then open `http://<server-public-ip>:7396`in your local browser.
188
+
> Make sure port 7396 is allowed in the server's firewall / security group rules.
189
+
190
+
### Scenario 2 — Browse historical data only
191
+
192
+
No tracing needed. Just start the server pointing at an existing database:
193
+
194
+
```bash
195
+
agentsight serve --db /path/to/genai_events.db
196
+
```
197
+
198
+
Open `http://127.0.0.1:7396` to explore recorded conversations and traces.
199
+
200
+
### Dashboard Development
201
+
202
+
To iterate on the frontend without rebuilding the Rust binary:
203
+
204
+
```bash
205
+
cd src/agentsight/dashboard
206
+
npm install
207
+
npm run dev # starts webpack-dev-server on http://localhost:3004
208
+
```
209
+
210
+
When finished, run `make build-frontend && cargo build --release` to embed the updated UI.
0 commit comments