@platformatic/watt-extra 1.16.0 → 1.17.0

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.
@@ -36,9 +36,9 @@ jobs:
36
36
 
37
37
  steps:
38
38
  - uses: actions/checkout@v7
39
- - uses: pnpm/action-setup@v4.2.0
39
+ - uses: pnpm/action-setup@v6.0.10
40
40
  with:
41
- version: 10
41
+ version: 11
42
42
 
43
43
  - name: Use Node.js ${{ matrix.node-version }}
44
44
  uses: actions/setup-node@v7
package/lib/errors.js CHANGED
@@ -19,6 +19,10 @@ const MetadataRuntimeNotStartedError = createError('PLT_METADATA_RUNTIME_NOT_STA
19
19
  const StatusSendError = createError('PLT_STATUS_SEND_ERROR', 'Failed to send application status')
20
20
  const StatusAppIdError = createError('PLT_STATUS_APPID_ERROR', 'Cannot send application status: no applicationId available')
21
21
 
22
+ // Profiling errors
23
+ const ProfilingRuntimeNotAvailableError = createError('PLT_PROFILING_RUNTIME_NOT_AVAILABLE_ERROR', 'Runtime not available, cannot toggle profiling')
24
+ const ProfilingStatesSendError = createError('PLT_PROFILING_STATES_SEND_ERROR', 'Failed to send profiling states: %s')
25
+
22
26
  export {
23
27
  CompliancyMetadataError,
24
28
  CompliancyStatusError,
@@ -30,5 +34,7 @@ export {
30
34
  MetadataAppIdError,
31
35
  MetadataRuntimeNotStartedError,
32
36
  StatusSendError,
33
- StatusAppIdError
37
+ StatusAppIdError,
38
+ ProfilingRuntimeNotAvailableError,
39
+ ProfilingStatesSendError
34
40
  }
package/lib/utils.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { access, rm, readdir } from 'node:fs/promises'
2
- import { execa } from 'execa'
3
2
 
4
3
  async function fileExists (path) {
5
4
  try {
@@ -23,12 +22,4 @@ async function dirExists (dir) {
23
22
  }
24
23
  }
25
24
 
26
- async function extractTarball (tarballPath, dir) {
27
- const child = execa('tar', ['-xf', tarballPath, '-C', dir])
28
- child.stdout.pipe(process.stdout)
29
- child.stderr.pipe(process.stderr)
30
-
31
- await child
32
- }
33
-
34
- export { fileExists, dirExists, extractTarball }
25
+ export { fileExists, dirExists }
package/lib/watt.js CHANGED
@@ -245,11 +245,26 @@ class Watt {
245
245
  ]
246
246
  }
247
247
 
248
- if (this.#env.PLT_DISABLE_FLAMEGRAPHS !== true) {
248
+ // Always load the pprof capture preload: PLT_DISABLE_FLAMEGRAPHS only
249
+ // controls whether profiling starts at boot, and ICC can activate it at
250
+ // runtime on this pod with the start-profiling command. The preload is
251
+ // passive until startProfiling is invoked.
252
+ // The module is resolved from watt-extra's own dependencies. If it is
253
+ // missing anyway (e.g. a stripped install), the pod boots without it:
254
+ // profiling is unavailable and the workers are reported as unsupported.
255
+ let pprofPath = null
256
+ try {
257
+ pprofPath = require.resolve('@platformatic/wattpm-pprof-capture')
258
+ } catch {
259
+ this.#logger.warn(
260
+ '@platformatic/wattpm-pprof-capture is not available, profiling is disabled on this pod'
261
+ )
262
+ }
263
+
264
+ if (pprofPath !== null) {
249
265
  if (config.preload === undefined) {
250
266
  config.preload = []
251
267
  }
252
- const pprofPath = require.resolve('@platformatic/wattpm-pprof-capture')
253
268
  config.preload.push(pprofPath)
254
269
  }
255
270
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/watt-extra",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "The Platformatic runtime manager",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -19,38 +19,37 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "@fastify/websocket": "^11.1.0",
22
- "@platformatic/composer": "^3.62.2",
23
- "@platformatic/next": "^3.62.2",
24
- "@platformatic/node": "^3.62.2",
25
- "@platformatic/service": "^3.62.2",
22
+ "@platformatic/composer": "^3.68.0",
23
+ "@platformatic/next": "^3.68.0",
24
+ "@platformatic/node": "^3.68.0",
25
+ "@platformatic/service": "^3.68.0",
26
26
  "atomic-sleep": "^1.0.0",
27
27
  "borp": "^1.0.0",
28
- "eslint": "9",
28
+ "eslint": "10",
29
29
  "fastify": "^5.10.0",
30
- "fastify-plugin": "^5.0.1",
31
- "neostandard": "^0.12.0",
30
+ "fastify-plugin": "^6.0.0",
31
+ "neostandard": "0.14.0-next.1",
32
32
  "next": "^16.2.10",
33
- "platformatic": "^3.62.2",
33
+ "platformatic": "^3.68.0",
34
34
  "pprof-format": "^2.1.0",
35
35
  "why-is-node-running": "^2.3.0"
36
36
  },
37
37
  "dependencies": {
38
38
  "@datadog/pprof": "^5.9.0",
39
39
  "@fastify/error": "^4.2.0",
40
- "@platformatic/foundation": "^3.62.2",
41
- "@platformatic/runtime": "^3.62.2",
42
- "@platformatic/wattpm-pprof-capture": "^3.62.2",
40
+ "@platformatic/foundation": "^3.68.0",
41
+ "@platformatic/runtime": "^3.68.0",
42
+ "@platformatic/wattpm-pprof-capture": "^3.68.0",
43
43
  "avvio": "^9.1.0",
44
44
  "chalk": "^4.1.2",
45
45
  "commist": "^3.2.0",
46
- "env-schema": "^7.0.0",
47
- "execa": "^9.6.0",
46
+ "env-schema": "^8.0.0",
48
47
  "help-me": "^5.0.0",
49
48
  "minimist": "^1.2.8",
50
49
  "pino": "^10.0.0",
51
50
  "pino-pretty": "^13.0.0",
52
51
  "semver": "^7.7.3",
53
- "undici": "^7.11.0",
52
+ "undici": "^8.0.0",
54
53
  "undici-cache-redis": "^1.0.0",
55
54
  "undici-slicer-interceptor": "^0.4.1",
56
55
  "undici-traffic-interceptor": "^0.1.4",
package/plugins/env.js CHANGED
@@ -17,12 +17,14 @@ const schema = {
17
17
  PLT_APP_INTERNAL_SUB_DOMAIN: { type: 'string', default: 'plt.local' },
18
18
  PLT_DEFAULT_CACHE_TAGS_HEADER: { type: 'string', default: 'x-plt-cache-tags' },
19
19
  PLT_CACHE_CONFIG: { type: 'string' },
20
- PLT_DISABLE_FLAMEGRAPHS: { type: 'boolean', default: false },
20
+ PLT_DISABLE_FLAMEGRAPHS: { type: 'boolean', default: true },
21
21
  PLT_FLAMEGRAPHS_INTERVAL_SEC: { type: 'number', default: 60 },
22
22
  PLT_FLAMEGRAPHS_ELU_THRESHOLD: { type: 'number', default: 0.4 },
23
23
  PLT_FLAMEGRAPHS_GRACE_PERIOD: { type: 'number', default: 3000 },
24
24
  PLT_FLAMEGRAPHS_ATTEMPT_TIMEOUT: { type: 'number', default: 10000 },
25
25
  PLT_FLAMEGRAPHS_CACHE_CLEANUP_INTERVAL: { type: 'number', default: 120000 },
26
+ PLT_FLAMEGRAPHS_STATE_REPORT_INTERVAL: { type: 'number', default: 30000 },
27
+ PLT_FLAMEGRAPHS_STATE_QUERY_TIMEOUT: { type: 'number', default: 5000 },
26
28
  PLT_JWT_EXPIRATION_OFFSET_SEC: { type: 'number', default: 60 },
27
29
  PLT_UPDATES_RECONNECT_INTERVAL_SEC: { type: 'number', default: 1 },
28
30
  PLT_ELU_HEALTH_SIGNAL_THRESHOLD: { type: 'number', default: 0.7 },