@platformatic/watt-extra 1.5.0 → 1.5.2
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.
- package/package.json +1 -1
- package/plugins/alerts.js +5 -1
- package/plugins/env.js +1 -1
- package/plugins/health-signals.js +5 -1
- package/plugins/init.js +2 -0
package/package.json
CHANGED
package/plugins/alerts.js
CHANGED
|
@@ -11,7 +11,11 @@ async function alerts (app, _opts) {
|
|
|
11
11
|
|
|
12
12
|
async function setupAlerts () {
|
|
13
13
|
const scalerAlgorithmVersion = app.instanceConfig?.scaler?.version ?? 'v1'
|
|
14
|
-
if (scalerAlgorithmVersion !== 'v1')
|
|
14
|
+
if (scalerAlgorithmVersion !== 'v1') {
|
|
15
|
+
app.log.info({ scalerVersion: scalerAlgorithmVersion }, 'Skipping v1 alerts setup, scaler version is not v1')
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
app.log.info('Setting up v1 scaler alerts')
|
|
15
19
|
|
|
16
20
|
// Skip alerts setup if ICC is not configured
|
|
17
21
|
if (!app.env.PLT_ICC_URL) {
|
package/plugins/env.js
CHANGED
|
@@ -23,7 +23,7 @@ const schema = {
|
|
|
23
23
|
PLT_FLAMEGRAPHS_GRACE_PERIOD: { type: 'number', default: 3000 },
|
|
24
24
|
PLT_JWT_EXPIRATION_OFFSET_SEC: { type: 'number', default: 60 },
|
|
25
25
|
PLT_UPDATES_RECONNECT_INTERVAL_SEC: { type: 'number', default: 1 },
|
|
26
|
-
PLT_ELU_HEALTH_SIGNAL_THRESHOLD: { type: 'number', default: 0.
|
|
26
|
+
PLT_ELU_HEALTH_SIGNAL_THRESHOLD: { type: 'number', default: 0.8 },
|
|
27
27
|
PLT_HEAP_HEALTH_SIGNAL_THRESHOLD: { type: ['number', 'string'], default: '4GB' }
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -36,7 +36,11 @@ async function healthSignals (app, _opts) {
|
|
|
36
36
|
|
|
37
37
|
async function setupHealthSignals () {
|
|
38
38
|
const scalerAlgorithmVersion = app.instanceConfig?.scaler?.version ?? 'v1'
|
|
39
|
-
if (scalerAlgorithmVersion !== 'v2')
|
|
39
|
+
if (scalerAlgorithmVersion !== 'v2') {
|
|
40
|
+
app.log.info({ scalerVersion: scalerAlgorithmVersion }, 'Skipping v2 health signals setup, scaler version is not v2')
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
app.log.info('Setting up v2 scaler health signals')
|
|
40
44
|
|
|
41
45
|
const runtimeVersion = app.watt.getRuntimeVersion()
|
|
42
46
|
if (semver.lt(runtimeVersion, '1.4.0')) {
|
package/plugins/init.js
CHANGED
|
@@ -42,6 +42,8 @@ async function initPlugin (app) {
|
|
|
42
42
|
|
|
43
43
|
instanceConfig.scaler ??= { version: 'v1' }
|
|
44
44
|
|
|
45
|
+
app.log.info({ scalerVersion: instanceConfig.scaler.version }, 'Scaler version configured')
|
|
46
|
+
|
|
45
47
|
// Use the application name from the ICC response if not provided
|
|
46
48
|
applicationName = applicationName || instanceConfig.applicationName
|
|
47
49
|
app.log.info({ applicationName }, 'Application name resolved')
|