Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Use supported Node.js Version
uses: actions/setup-node@v6
with:
node-version: 24
node-version: '24.20.0'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- name: Restore cached dependencies
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,6 @@ web/backend/openapi.json

# profiles
watt-admin-*.html

# SSRT
.plt
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ Select a runtime: (Use arrow keys)

If only one runtime is running, it will be selected automatically.

With Watt v4, Watt Admin enables metrics on the selected runtime before starting the dashboard, without restarting workers or replacing existing metrics options. This requires a Watt version that supports `PATCH /api/v1/metrics`. Changes are in-memory only and are not reverted when the dashboard closes.

The Watt packages are pinned to `4.0.0-alpha.2`.

### Custom Port

Run Watt Admin on a different port:
Expand Down Expand Up @@ -104,7 +108,7 @@ The generated HTML file contains everything you need for offline analysis—perf

### Prerequisites

- Node.js 18 or higher
- Node.js 24.20.0 or higher
- A running Platformatic runtime to monitor

### Setup
Expand Down
2 changes: 1 addition & 1 deletion lib/start.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import type { RuntimeApiClient } from '@platformatic/control'

export declare function start (client: RuntimeApiClient, selectedRuntime: string): Promise<void>
export declare function start (client: RuntimeApiClient, selectedRuntime: number | string): Promise<void>
20 changes: 14 additions & 6 deletions lib/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export async function start (client, selectedRuntime) {

process.env.WATT_ADMIN_PORT = port || 4042

// Enable collection on the selected runtime without replacing its existing metrics options.
await client.updateRuntimeMetricsConfig(Number(selectedRuntime), { enabled: true })

const requestRecord = async (mode) => {
return await request(`${entrypointUrl}/api/record/${selectedRuntime}`, {
method: 'POST',
Expand Down Expand Up @@ -53,12 +56,17 @@ export async function start (client, selectedRuntime) {
const cwd = process.cwd()
const root = join(import.meta.dirname, '..')
process.chdir(root)
const server = await create('watt.json', undefined, {
setupSignals: false,
isProduction: true
})
entrypointUrl = await server.start()
process.chdir(cwd)
let server
try {
server = await create('watt.config.js', undefined, {
setupSignals: false,
isProduction: true
})
const urls = await server.start()
entrypointUrl = urls['composer:0']
} finally {
process.chdir(cwd)
}

if (record) {
async function shutdown () {
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"type": "module",
"name": "@platformatic/watt-admin",
"version": "1.3.0",
"engines": {
"node": ">=24.20.0"
},
"repository": {
"url": "https://github.com/platformatic/watt-admin"
},
Expand Down Expand Up @@ -29,13 +32,13 @@
"@fastify/type-provider-json-schema-to-ts": "^5.0.0",
"@fastify/websocket": "^11.2.0",
"@inquirer/prompts": "^8.0.0",
"@platformatic/control": "^3.36.0",
"@platformatic/gateway": "^3.36.0",
"@platformatic/runtime": "^3.36.0",
"@platformatic/service": "^3.36.0",
"@platformatic/control": "4.0.0-alpha.2",
"@platformatic/gateway": "4.0.0-alpha.2",
"@platformatic/runtime": "4.0.0-alpha.2",
"@platformatic/service": "4.0.0-alpha.2",
"@platformatic/ui-components": "^0.20.0",
"@platformatic/vite": "^3.11.0",
"@platformatic/wattpm-pprof-capture": "^3.36.0",
"@platformatic/vite": "4.0.0-alpha.2",
"@platformatic/wattpm-pprof-capture": "4.0.0-alpha.2",
"@scalar/api-reference-react": "^0.9.0",
"@vitejs/plugin-react": "^5.0.4",
"amaro": "^1.1.4",
Expand All @@ -56,7 +59,7 @@
"use-error-boundary": "^2.0.6",
"vite": "^7.1.9",
"vite-plugin-singlefile": "^2.3.0",
"wattpm": "^3.36.0",
"wattpm": "4.0.0-alpha.2",
"zustand": "^5.0.8"
},
"devDependencies": {
Expand All @@ -82,4 +85,4 @@
"bin": {
"watt-admin": "cli.js"
}
}
}
Loading
Loading