Skip to content

Commit f80d0b5

Browse files
committed
update README
Signed-off-by: JaredforReal <[email protected]>
1 parent 15753b0 commit f80d0b5

File tree

2 files changed

+31
-55
lines changed

2 files changed

+31
-55
lines changed

dashboard/README.md

Lines changed: 30 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Semantic Router Modern Dashboard
1+
# Semantic Router Dashboard
22

33
Unified dashboard that brings together Configuration Management, an Interactive Playground, and Real-time Monitoring & Observability. It provides a single entry point across local, Docker Compose, and Kubernetes deployments.
44

@@ -12,16 +12,15 @@ Unified dashboard that brings together Configuration Management, an Interactive
1212
## What’s already in this repo (reused)
1313

1414
- Prometheus + Grafana
15-
- Docker Compose services in `docker-compose.yml` (ports: Prometheus 9090, Grafana 3000)
16-
- Local observability in `docker-compose.obs.yml` (host network)
15+
- Docker Compose services in `deploy/docker-compose/docker-compose.yml` (Prometheus 9090, Grafana 3000)
16+
- Local observability in `tools/observability/docker-compose.obs.yml` (host network)
1717
- K8s manifests under `deploy/kubernetes/observability/{prometheus,grafana}`
1818
- Provisioned datasource and dashboard in `tools/observability/`
1919
- Router metrics and API
2020
- Metrics at `:9190/metrics` (Prometheus format)
2121
- Classification API on `:8080` with endpoints like `GET /api/v1`, `GET /config/classification`
2222
- Open WebUI integration
2323
- Pipe in `tools/openwebui-pipe/vllm_semantic_router_pipe.py`
24-
- Doc in `website/docs/tutorials/observability/open-webui-integration.md`
2524

2625
These are sufficient to embed and proxy—no need to duplicate core functionality.
2726

@@ -58,6 +57,7 @@ Features:
5857
- `GET /embedded/openwebui/*` → Open WebUI (optional)
5958
- `GET /api/router/*` → Router Classification API (`:8080`)
6059
- `GET /metrics/router` → Router `/metrics` (optional aggregation later)
60+
- `GET /api/router/config/all` → Returns your `config.yaml` as JSON (read-only)
6161
- `GET /healthz` → Health check endpoint
6262
- Normalizes headers for iframe embedding: strips/overrides `X-Frame-Options` and `Content-Security-Policy` frame-ancestors as needed
6363
- SPA routing support: serves `index.html` for all non-asset routes
@@ -90,10 +90,9 @@ dashboard/
9090
│ ├── go.mod # Go module (minimal dependencies)
9191
│ └── Dockerfile # Multi-stage build (Node + Go + Alpine)
9292
├── deploy/
93-
│ ├── docker/ # Docker Compose overlay (deprecated)
94-
│ └── kubernetes/ # K8s manifests (Service/Ingress/ConfigMap)
93+
│ └── kubernetes/ # K8s manifests (Deployment/Service/ConfigMap)
9594
├── README.md # This file
96-
└── RISKS.md # Security considerations
95+
└── (no RISKS.md) # Security considerations are documented inline for now
9796
```
9897

9998
## Environment-agnostic configuration
@@ -108,7 +107,7 @@ Required env vars (with sensible defaults per environment):
108107
- `TARGET_ROUTER_API_URL` (router `:8080`)
109108
- `TARGET_ROUTER_METRICS_URL` (router `:9190/metrics`)
110109
- `TARGET_OPENWEBUI_URL` (optional; enable playground tab only if present)
111-
- `ALLOW_IFRAME_EMBED` (default: true; backend will remove/override frame-busting headers)
110+
Note: The backend already adjusts frame-busting headers (X-Frame-Options/CSP) to allow embedding from the dashboard origin; no extra env flag is required.
112111

113112
Recommended upstream settings for embedding:
114113

@@ -119,14 +118,14 @@ Recommended upstream settings for embedding:
119118

120119
- Dashboard Home: `http://<host>:8700/`
121120
- Monitoring tab: iframe `src="/embedded/grafana/d/<dashboard-uid>?kiosk&theme=light"`
122-
- Config tab: frontend fetch `GET /api/router/config/classification`
121+
- Config tab: frontend fetch `GET /api/router/config/all`
123122
- Playground tab: iframe `src="/embedded/openwebui/"` (rendered only if `TARGET_OPENWEBUI_URL` is set)
124123

125124
## Deployment matrix
126125

127126
1) Local dev (router and observability on host)
128127

129-
- Use `docker-compose.obs.yml` to start Prometheus (9090) and Grafana (3000) on host network
128+
- Use `tools/observability/docker-compose.obs.yml` to start Prometheus (9090) and Grafana (3000) on host network
130129
- Start dashboard backend locally (port 8700)
131130
- Env examples:
132131
- `TARGET_GRAFANA_URL=http://localhost:3000`
@@ -137,8 +136,7 @@ Recommended upstream settings for embedding:
137136

138137
2) Docker Compose (all-in-one)
139138

140-
- Reuse services defined in root `docker-compose.yml`
141-
- Add dashboard and optional Open WebUI services in `dashboard/deploy/docker/compose.yml`
139+
- Reuse services defined in `deploy/docker-compose/docker-compose.yml` (Dashboard included by default)
142140
- Env examples (inside compose network):
143141
- `TARGET_GRAFANA_URL=http://grafana:3000`
144142
- `TARGET_PROMETHEUS_URL=http://prometheus:9090`
@@ -170,37 +168,21 @@ Recommended upstream settings for embedding:
170168
- New integrations: add target env vars and a new `/embedded/<service>` route in backend proxy
171169
- Metrics aggregation: add `/api/metrics` in backend to produce derived KPIs from Prometheus
172170

173-
## Implementation milestones
171+
## Implementation notes
174172

175-
1) MVP (this PR)
176-
177-
- Scaffold `dashboard/` (this README)
178-
- Backend: Go server with reverse proxies for `/embedded/*` and `/api/router/*`
179-
- Frontend: minimal SPA with three tabs and iframes + JSON viewer
180-
- Compose overlay: `dashboard/deploy/docker/compose.yml` to launch dashboard with existing stack
181-
182-
2) K8s manifests
183-
184-
- Deployment + Service + ConfigMap with env vars; optional Ingress
185-
- Document `kubectl port-forward` for dev
186-
187-
3) Auth hardening and polish
188-
189-
- Env toggles for anonymous/off
190-
- OIDC enablement behind a flag
191-
- Metrics summary endpoint
173+
— Backend: Go server with reverse proxies for `/embedded/*` and `/api/router/*`, plus `/api/router/config/all`
174+
— Frontend: SPA with three tabs and iframes + structured config viewer
175+
— K8s manifests: Deployment + Service + ConfigMap; optional Ingress (add per cluster)
176+
— Future: OIDC, per-route RBAC, metrics summary endpoint
192177

193178
## Quick Start
194179

195-
### Method 1: One-click Start with Docker Compose (Recommended)
180+
### Method 1: Start with Docker Compose (Recommended)
196181

197182
The Dashboard is integrated into the main Compose stack, requiring no extra configuration:
198183

199184
```bash
200-
# Run from the project root directory
201-
make docker-compose-up
202-
203-
# Or use docker compose directly
185+
# From the project root directory
204186
docker compose -f deploy/docker-compose/docker-compose.yml up -d --build
205187
```
206188

@@ -215,33 +197,25 @@ After startup, access:
215197
When developing the Dashboard code locally:
216198

217199
```bash
218-
# 1. Start the local Observability stack
219-
make o11y-local
220-
# Or
200+
# 1) Start Observability locally (Prometheus + Grafana on host network)
221201
docker compose -f tools/observability/docker-compose.obs.yml up -d
222202

223-
# 2. Start the Router (in another terminal)
224-
cd src/semantic-router
225-
go run cmd/main.go -config ../../config/config.yaml
226-
227-
# 3. Install frontend dependencies
203+
# 2) Install frontend dependencies and run Vite dev server
228204
cd dashboard/frontend
229205
npm install
230-
231-
# 4. Start the frontend dev server (with HMR)
232206
npm run dev
233-
# Vite will start on http://localhost:3001 with proxy to backend
207+
# Vite runs at http://localhost:3001 and proxies /api and /embedded to http://localhost:8700
234208

235-
# 5. Start the Dashboard backend (in another terminal)
209+
# 3) Start the Dashboard backend in another terminal
236210
cd dashboard/backend
237211
export TARGET_GRAFANA_URL=http://localhost:3000
238212
export TARGET_PROMETHEUS_URL=http://localhost:9090
239213
export TARGET_ROUTER_API_URL=http://localhost:8080
240214
export TARGET_ROUTER_METRICS_URL=http://localhost:9190/metrics
241-
go run main.go -port=8700 -static=../frontend/dist
215+
export ROUTER_CONFIG_PATH=../../config/config.yaml
216+
go run main.go -port=8700 -static=../frontend/dist -config=$ROUTER_CONFIG_PATH
242217

243-
# For development, use the Vite dev server at http://localhost:3001
244-
# For production preview, build first: cd frontend && npm run build
218+
# Tip: If your router runs inside Docker Compose, point TARGET_* to the container hostnames instead.
245219
```
246220

247221
### Method 3: Rebuild Dashboard Only
@@ -263,8 +237,8 @@ docker logs -f semantic-router-dashboard
263237

264238
### Docker Compose Integration Notes
265239

266-
- The Dashboard service is integrated as a **default service** in `deploy/docker-compose/docker-compose.yml`.
267-
- No additional overlay files are needed; `make docker-compose-up` will automatically start all services.
240+
- The Dashboard service is integrated as a default service in `deploy/docker-compose/docker-compose.yml`.
241+
- No additional overlay files are needed; the compose file will start all services.
268242
- The Dashboard depends on the `semantic-router` (for health checks), `grafana`, and `prometheus` services.
269243

270244
### Dockerfile Build
@@ -289,6 +263,8 @@ Grafana is already configured for embedding in `deploy/docker-compose/docker-com
289263
290264
The Dashboard reverse proxy will automatically clean up `X-Frame-Options` and adjust CSP headers to ensure the iframe loads correctly.
291265

266+
Default dashboard path in Monitoring tab: `/d/llm-router-metrics/llm-router-metrics`.
267+
292268
### Health Check
293269

294270
The Dashboard provides a `/healthz` endpoint for container health checks:
@@ -300,5 +276,5 @@ curl http://localhost:8700/healthz
300276

301277
## Notes
302278

303-
- The website/ (Docusaurus) remains for documentation. The dashboard is a runtime operator/try-it surface, not docs.
304-
- We’ll keep upstream services untouched and do all UX unification at the proxy + SPA layer.
279+
- The dashboard is a runtime operator/try-it surface, not docs. See repository docs for broader guides.
280+
- Upstream services remain untouched; UX unification happens at the proxy + SPA layer.

dashboard/frontend/src/pages/MonitoringPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const MonitoringPage: React.FC = () => {
77
return document.documentElement.getAttribute('data-theme') || 'dark'
88
}
99

10-
const [grafanaPath, setGrafanaPath] = useState('/d/semantic-router-dashboard/semantic-router')
10+
const [grafanaPath, setGrafanaPath] = useState('/d/llm-router-metrics/llm-router-metrics')
1111
const [currentPath, setCurrentPath] = useState(grafanaPath)
1212
const [theme, setTheme] = useState(getTheme())
1313
const [loading, setLoading] = useState(true)

0 commit comments

Comments
 (0)