@platformatic/watt-extra 0.1.6 → 0.1.7-alpha.1

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/lib/watt.js CHANGED
@@ -416,6 +416,7 @@ class Watt {
416
416
  ...config.health,
417
417
  enabled: true,
418
418
  interval: 1000,
419
+ gracePeriod: 1000,
419
420
  maxUnhealthyChecks: 30,
420
421
  }
421
422
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/watt-extra",
3
- "version": "0.1.6",
3
+ "version": "0.1.7-alpha.1",
4
4
  "description": "The Platformatic runtime manager",
5
5
  "type": "module",
6
6
  "scripts": {
package/plugins/alerts.js CHANGED
@@ -26,6 +26,8 @@ async function alerts (app, _opts) {
26
26
  }
27
27
 
28
28
  runtime.on('health', async (healthInfo) => {
29
+ process._rawDebug('-------RUNTIME ON HEALTH---------', JSON.stringify(healthInfo, null, 2))
30
+
29
31
  if (!healthInfo) {
30
32
  app.log.error('No health info received')
31
33
  return
@@ -76,6 +78,7 @@ async function alerts (app, _opts) {
76
78
 
77
79
  const authHeaders = await app.getAuthorizationHeader()
78
80
 
81
+ process._rawDebug('-------SENDING ALERT---------', JSON.stringify(healthInfo, null, 2), `${scalerUrl}/alerts`)
79
82
  const { statusCode, body } = await request(`${scalerUrl}/alerts`, {
80
83
  method: 'POST',
81
84
  headers: {
@@ -89,6 +92,8 @@ async function alerts (app, _opts) {
89
92
  }),
90
93
  })
91
94
 
95
+ process._rawDebug('--------ALERT SENT---------', statusCode)
96
+
92
97
  if (statusCode !== 200) {
93
98
  const error = await body.text()
94
99
  app.log.error({ error }, 'Failed to send alert to scaler')