@certik/skynet 0.8.14 → 0.8.15
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/CHANGELOG.md +4 -0
- package/app.js +8 -16
- package/monitor.js +7 -6
- package/opsgenie.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/app.js
CHANGED
|
@@ -202,8 +202,7 @@ function indexer({ name, selector, build, check, env = {}, region = "us-east-1"
|
|
|
202
202
|
bin: `${bin} check`,
|
|
203
203
|
schedule: check.schedule,
|
|
204
204
|
cpu: check.cpu || 100,
|
|
205
|
-
mem: check.mem || 100
|
|
206
|
-
hasSlack: check.slackChannel,
|
|
205
|
+
mem: check.mem || 100
|
|
207
206
|
},
|
|
208
207
|
});
|
|
209
208
|
|
|
@@ -216,8 +215,7 @@ function indexer({ name, selector, build, check, env = {}, region = "us-east-1"
|
|
|
216
215
|
type: "stateless",
|
|
217
216
|
selector,
|
|
218
217
|
check: check.func,
|
|
219
|
-
maxRetry: check.maxRetry
|
|
220
|
-
slackChannel: check.slackChannel,
|
|
218
|
+
maxRetry: check.maxRetry
|
|
221
219
|
});
|
|
222
220
|
|
|
223
221
|
monitor();
|
|
@@ -317,8 +315,7 @@ function modeIndexer({ name, selector, state, build, validate, check, env = {},
|
|
|
317
315
|
bin: `${bin} check`,
|
|
318
316
|
schedule: check.schedule,
|
|
319
317
|
cpu: check.cpu || 100,
|
|
320
|
-
mem: check.mem || 100
|
|
321
|
-
hasSlack: check.slackChannel,
|
|
318
|
+
mem: check.mem || 100
|
|
322
319
|
},
|
|
323
320
|
});
|
|
324
321
|
|
|
@@ -332,8 +329,7 @@ function modeIndexer({ name, selector, state, build, validate, check, env = {},
|
|
|
332
329
|
selector,
|
|
333
330
|
mode: true,
|
|
334
331
|
check: check.func,
|
|
335
|
-
maxRetry: check.maxRetry
|
|
336
|
-
slackChannel: check.slackChannel,
|
|
332
|
+
maxRetry: check.maxRetry
|
|
337
333
|
});
|
|
338
334
|
|
|
339
335
|
monitor();
|
|
@@ -421,8 +417,7 @@ function producer({ name, selector, produce, check, state, env = {}, region = "u
|
|
|
421
417
|
bin: `${bin} check`,
|
|
422
418
|
schedule: check.schedule,
|
|
423
419
|
cpu: check.cpu || 100,
|
|
424
|
-
mem: check.mem || 100
|
|
425
|
-
hasSlack: check.slackChannel,
|
|
420
|
+
mem: check.mem || 100
|
|
426
421
|
},
|
|
427
422
|
});
|
|
428
423
|
|
|
@@ -435,8 +430,7 @@ function producer({ name, selector, produce, check, state, env = {}, region = "u
|
|
|
435
430
|
type: "stateful",
|
|
436
431
|
selector,
|
|
437
432
|
check: check.func,
|
|
438
|
-
maxRetry: check.maxRetry
|
|
439
|
-
slackChannel: check.slackChannel,
|
|
433
|
+
maxRetry: check.maxRetry
|
|
440
434
|
});
|
|
441
435
|
|
|
442
436
|
monitor();
|
|
@@ -515,8 +509,7 @@ function consumer({ name, selector, consume, check, env = {}, region = "us-east-
|
|
|
515
509
|
bin: `${bin} check`,
|
|
516
510
|
schedule: check.schedule,
|
|
517
511
|
cpu: check.cpu || 100,
|
|
518
|
-
mem: check.mem || 100
|
|
519
|
-
hasSlack: check.slackChannel,
|
|
512
|
+
mem: check.mem || 100
|
|
520
513
|
},
|
|
521
514
|
});
|
|
522
515
|
|
|
@@ -529,8 +522,7 @@ function consumer({ name, selector, consume, check, env = {}, region = "us-east-
|
|
|
529
522
|
type: "stateless",
|
|
530
523
|
selector,
|
|
531
524
|
check: check.func,
|
|
532
|
-
maxRetry: check.maxRetry
|
|
533
|
-
slackChannel: check.slackChannel,
|
|
525
|
+
maxRetry: check.maxRetry
|
|
534
526
|
});
|
|
535
527
|
|
|
536
528
|
monitor();
|
package/monitor.js
CHANGED
|
@@ -4,9 +4,8 @@ const { getSelectorFlags, getSelectorDesc, toSelectorString } = require("./selec
|
|
|
4
4
|
const { getBinaryName } = require("./cli");
|
|
5
5
|
const { exponentialRetry } = require("./availability");
|
|
6
6
|
const { getIndexerLatestId, getIndexerValidatedId, getIndexerState } = require("./indexer");
|
|
7
|
-
const { postMessage } = require("./slack");
|
|
8
7
|
const { postGenieMessage } = require("./opsgenie");
|
|
9
|
-
const { getJobName
|
|
8
|
+
const { getJobName } = require("./deploy");
|
|
10
9
|
|
|
11
10
|
const ERROR_LEVEL = {
|
|
12
11
|
INFO: "Info",
|
|
@@ -90,7 +89,6 @@ function createMonitor({
|
|
|
90
89
|
name,
|
|
91
90
|
type = "stateless",
|
|
92
91
|
mode = false,
|
|
93
|
-
slackChannel,
|
|
94
92
|
selector = {},
|
|
95
93
|
check,
|
|
96
94
|
maxRetry = 2,
|
|
@@ -181,8 +179,11 @@ ${
|
|
|
181
179
|
if (production) {
|
|
182
180
|
// Also alert on opsgenie (func prevents duplicate alerts)
|
|
183
181
|
await postGenieMessage(
|
|
184
|
-
`${jobName} Monitor Errors
|
|
185
|
-
|
|
182
|
+
`${jobName} Monitor Errors`,
|
|
183
|
+
`${sortErrors(result)
|
|
184
|
+
.map((m) => m.message || m)
|
|
185
|
+
.join("\n")}`,
|
|
186
|
+
verbose
|
|
186
187
|
);
|
|
187
188
|
}
|
|
188
189
|
|
|
@@ -212,4 +213,4 @@ ${
|
|
|
212
213
|
return { monitor };
|
|
213
214
|
}
|
|
214
215
|
|
|
215
|
-
module.exports = { createMonitor, ERROR_LEVEL };
|
|
216
|
+
module.exports = { createMonitor, ERROR_LEVEL, LEVEL_EMOJI };
|
package/opsgenie.js
CHANGED