by-framework-dashboard 0.1.0__tar.gz

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.
@@ -0,0 +1,73 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .ruff_cache/
7
+ .Python
8
+ build/
9
+ develop-eggs/
10
+ dist/
11
+ downloads/
12
+ eggs/
13
+ .eggs/
14
+ lib/
15
+ lib64/
16
+ parts/
17
+ sdist/
18
+ var/
19
+ wheels/
20
+ share/python-wheels/
21
+ *.egg-info/
22
+ .installed.cfg
23
+ *.egg
24
+ MANIFEST
25
+
26
+ # Environment
27
+ .env
28
+ .venv
29
+ env/
30
+ venv/
31
+ ENV/
32
+ env.bak/
33
+ venv.bak/
34
+
35
+ # Node.js
36
+ node_modules/
37
+ npm-debug.log*
38
+ yarn-debug.log*
39
+ yarn-error.log*
40
+ .pnpm-debug.log*
41
+ dist/
42
+ .cache/
43
+ .next/
44
+ out/
45
+ .next-env.d.ts
46
+
47
+ # IDEs / Editors
48
+ .idea/
49
+ .vscode/
50
+ *.swp
51
+ *.swo
52
+ .DS_Store
53
+ .DS_Store?
54
+ ._*
55
+ .Spotlight-V100
56
+ .Trashes
57
+ ehthumbs.db
58
+ Thumbs.db
59
+
60
+ # Project Specific
61
+ .worktrees/
62
+ *.log
63
+ .gemini/
64
+ /brain/
65
+ .agents/
66
+ .agent/
67
+ *gateway-sdk.log*
68
+ .claude/settings.local.json
69
+ .claude/settings.json
70
+
71
+ .coderfleet-uploads/
72
+
73
+ .claude/skills
@@ -0,0 +1,40 @@
1
+ # syntax=docker/dockerfile:1
2
+
3
+ FROM node:22-bookworm-slim AS frontend
4
+
5
+ WORKDIR /app/libs/by-framework-dashboard/frontend
6
+ COPY libs/by-framework-dashboard/frontend/package*.json ./
7
+ RUN npm ci --no-audit --progress=false
8
+ COPY libs/by-framework-dashboard/frontend/ ./
9
+ RUN npm run build
10
+
11
+ FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS runtime
12
+
13
+ ENV PYTHONUNBUFFERED=1 \
14
+ UV_NO_CACHE=1 \
15
+ PATH="/opt/venv/bin:${PATH}"
16
+
17
+ WORKDIR /app
18
+
19
+ COPY pyproject.toml uv.lock README.md ./
20
+ COPY src ./src
21
+ COPY libs/by-framework-dashboard ./libs/by-framework-dashboard
22
+ COPY libs/by-framework-trace-query ./libs/by-framework-trace-query
23
+ COPY --from=frontend /app/libs/by-framework-dashboard/src/by_framework_dashboard/static/ ./libs/by-framework-dashboard/src/by_framework_dashboard/static/
24
+
25
+ RUN uv venv /opt/venv \
26
+ && uv build --wheel --project . --out-dir /tmp/wheels \
27
+ && uv build --wheel --project libs/by-framework-trace-query --out-dir /tmp/wheels \
28
+ && uv build --wheel --project libs/by-framework-dashboard --out-dir /tmp/wheels \
29
+ && uv pip install --python /opt/venv/bin/python \
30
+ /tmp/wheels/by_framework-*.whl \
31
+ /tmp/wheels/by_framework_trace_query-*.whl \
32
+ /tmp/wheels/by_framework_dashboard-*.whl \
33
+ && rm -rf /tmp/wheels
34
+
35
+ EXPOSE 8765
36
+
37
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
38
+ CMD python -c "import json, urllib.request; response = urllib.request.urlopen('http://127.0.0.1:8765/api/health', timeout=3); json.load(response)"
39
+
40
+ CMD ["by-framework-dashboard", "--host", "0.0.0.0", "--port", "8765"]
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: by-framework-dashboard
3
+ Version: 0.1.0
4
+ Summary: Dashboard UI and HTTP server for by-framework observability
5
+ Requires-Python: >=3.12
6
+ Requires-Dist: by-framework-trace-query>=0.1.0
7
+ Requires-Dist: by-framework>=0.2.1
8
+ Provides-Extra: dev
9
+ Requires-Dist: isort>=5.13.0; extra == 'dev'
10
+ Requires-Dist: pyink>=24.0.0; extra == 'dev'
11
+ Requires-Dist: pylint>=3.0.0; extra == 'dev'
12
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
13
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
14
+ Requires-Dist: ruff>=0.3.0; extra == 'dev'
@@ -0,0 +1,174 @@
1
+ # by-framework-dashboard
2
+
3
+ Dashboard UI and HTTP server for inspecting by-framework workers, queues,
4
+ executions, sessions, traces, and Prometheus metrics.
5
+
6
+ ## Quick Start
7
+
8
+ From the repository root:
9
+
10
+ ```bash
11
+ uv run --package by-framework-dashboard by-framework-dashboard \
12
+ --host 127.0.0.1 \
13
+ --port 8765
14
+ ```
15
+
16
+ Then open:
17
+
18
+ ```text
19
+ http://127.0.0.1:8765
20
+ ```
21
+
22
+ ## Container Image
23
+
24
+ Dashboard release tags also publish a GHCR image:
25
+
26
+ ```text
27
+ ghcr.io/<owner>/by-framework-dashboard:<version>
28
+ ```
29
+
30
+ For example, pushing `by-framework-dashboard-v0.1.0` builds and publishes:
31
+
32
+ ```text
33
+ ghcr.io/<owner>/by-framework-dashboard:0.1.0
34
+ ghcr.io/<owner>/by-framework-dashboard:latest
35
+ ```
36
+
37
+ To run the image:
38
+
39
+ ```bash
40
+ docker run --rm -p 8765:8765 \
41
+ -e REDIS_HOST=host.docker.internal \
42
+ ghcr.io/<owner>/by-framework-dashboard:0.1.0
43
+ ```
44
+
45
+ For demo data without a live Redis cluster:
46
+
47
+ ```text
48
+ http://127.0.0.1:8765?demo=1
49
+ ```
50
+
51
+ ## Redis Configuration
52
+
53
+ The dashboard reads live data from the same Redis instance used by workers and
54
+ clients. You can configure Redis with CLI flags:
55
+
56
+ ```bash
57
+ uv run --package by-framework-dashboard by-framework-dashboard \
58
+ --host 127.0.0.1 \
59
+ --port 8765 \
60
+ --redis-host localhost \
61
+ --redis-port 6379 \
62
+ --redis-db 0
63
+ ```
64
+
65
+ Or with environment variables:
66
+
67
+ ```bash
68
+ export REDIS_HOST=localhost
69
+ export REDIS_PORT=6379
70
+ export REDIS_DB=0
71
+ export REDIS_USERNAME=
72
+ export REDIS_PASSWORD=
73
+
74
+ uv run --package by-framework-dashboard by-framework-dashboard
75
+ ```
76
+
77
+ Supported Redis env vars:
78
+
79
+ - `REDIS_HOST`
80
+ - `REDIS_PORT`
81
+ - `REDIS_DB`
82
+ - `REDIS_USERNAME`
83
+ - `REDIS_PASSWORD`
84
+ - `REDIS_MAX_CONNECTIONS`
85
+
86
+ ## Authentication
87
+
88
+ When binding to a non-localhost interface, configure a bearer token:
89
+
90
+ ```bash
91
+ export BY_FRAMEWORK_DASHBOARD_TOKEN="change-me"
92
+ uv run --package by-framework-dashboard by-framework-dashboard \
93
+ --host 0.0.0.0 \
94
+ --port 8765
95
+ ```
96
+
97
+ API and metrics requests must then include:
98
+
99
+ ```text
100
+ Authorization: Bearer change-me
101
+ ```
102
+
103
+ Static dashboard assets remain public; `/api/*` and `/metrics` are protected.
104
+
105
+ ## Useful Endpoints
106
+
107
+ - `/` - dashboard UI
108
+ - `/?demo=1` - dashboard UI with demo data
109
+ - `/api/health` - dashboard process health
110
+ - `/api/workers` - worker and agent health snapshot
111
+ - `/api/queues` - Redis stream queue snapshot
112
+ - `/api/executions` - recent execution snapshot
113
+ - `/api/session?session_id=<session_id>` - session execution and event details
114
+ - `/api/traces?session_id=<session_id>` - trace summaries through Trace Read SDK
115
+ - `/api/traces?worker_id=<worker_id>` - trace summaries by worker
116
+ - `/api/traces?agent_type=<agent_type>` - trace summaries by agent type
117
+ - `/api/trace/<trace_id>` - single trace detail through Trace Read SDK
118
+ - `/api/trace/<trace_id>?session_id=<session_id>` - single trace with session hint
119
+ - `/api/trace/<trace_id>/timeline` - trace timeline payload
120
+ - `/metrics` - Prometheus metrics
121
+
122
+ `/api/traces` in live mode requires at least one of `session_id`, `worker_id`,
123
+ or `agent_type`.
124
+
125
+ ## Trace Data
126
+
127
+ Trace APIs use `by-framework-trace-query` under the hood. In v1 the read source
128
+ is Redis:
129
+
130
+ - `by_framework:trace:{trace_id}`
131
+ - `by_framework:trace:spans:{trace_id}`
132
+ - session registry and session data stream fallback
133
+ - trace indexes by session, worker, and agent
134
+
135
+ If `BYAI_TRACE_FALLBACK_URL` is set, `/api/trace/<trace_id>` can fall back to an
136
+ external HTTP trace source when Redis has no spans for the requested trace.
137
+
138
+ ## Frontend Development
139
+
140
+ The packaged dashboard serves built static files from:
141
+
142
+ ```text
143
+ libs/by-framework-dashboard/src/by_framework_dashboard/static
144
+ ```
145
+
146
+ The editable React/Vite frontend lives in:
147
+
148
+ ```text
149
+ libs/by-framework-dashboard/frontend
150
+ ```
151
+
152
+ To work on the frontend:
153
+
154
+ ```bash
155
+ cd libs/by-framework-dashboard/frontend
156
+ npm install
157
+ npm run dev
158
+ ```
159
+
160
+ After frontend changes, build and copy the generated assets into the package
161
+ static directory according to the repository release workflow.
162
+
163
+ ## Troubleshooting
164
+
165
+ If the page loads but live data is empty:
166
+
167
+ - Confirm workers and clients use the same Redis host, port, and DB.
168
+ - Open `http://127.0.0.1:8765/api/health`.
169
+ - Try demo mode with `http://127.0.0.1:8765?demo=1`.
170
+ - Query a known trace directly with `/api/trace/<trace_id>`.
171
+ - Query trace lists with a filter, for example `/api/traces?session_id=<id>`.
172
+
173
+ If API requests return `unauthorized`, include the bearer token configured via
174
+ `--auth-token` or `BY_FRAMEWORK_DASHBOARD_TOKEN`.
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>by-framework observability</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.jsx"></script>
11
+ </body>
12
+ </html>