From f771af1401219558fa3a41f658a4de8a3efe5db7 Mon Sep 17 00:00:00 2001 From: Benjamin Langlotz Date: Fri, 8 Sep 2023 14:51:22 +0200 Subject: [PATCH] fix(deps-dev): bump kth-monitor --- package-lock.json | 17 ++++------------- package.json | 2 +- server/controllers/systemCtrl.js | 14 ++------------ 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index ca092410..43e2afb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@kth/kth-node-web-common": "^8.1.1", "@kth/kth-reactstrap": "^0.4.66", "@kth/log": "^4.0.7", - "@kth/monitor": "^3.0.31", + "@kth/monitor": "^4.1.1", "@kth/server": "^4.0.4", "@kth/session": "^3.0.8", "applicationinsights": "^2.7.3", @@ -3255,14 +3255,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/@kth/in-memory-cache": { - "version": "0.1.53", - "resolved": "https://registry.npmjs.org/@kth/in-memory-cache/-/in-memory-cache-0.1.53.tgz", - "integrity": "sha512-LlByeWdFmHbE5eUFzxu5qXTuLEGcHYB7vAilBpLT2YpsXBUcSDXOVqXLRU3dimxfcFJV5lDOmGaVx9/lBaO3Hg==", - "engines": { - "node": "^16" - } - }, "node_modules/@kth/kth-node-response": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@kth/kth-node-response/-/kth-node-response-1.0.7.tgz", @@ -3303,11 +3295,10 @@ } }, "node_modules/@kth/monitor": { - "version": "3.0.31", - "resolved": "https://registry.npmjs.org/@kth/monitor/-/monitor-3.0.31.tgz", - "integrity": "sha512-SXJFkLspRx4+CFDluyyDvdBqcyGrsxHt0h3MENTY6/0rnQw8vU0UkJ/h110RqUjLRyfYfBRKbUk20a9jmXt1ew==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@kth/monitor/-/monitor-4.1.1.tgz", + "integrity": "sha512-df97JMOfY82K/zxOSQnTaW+5Z61j84wLSMgcvmSd4K4qGWG9YejuFLovFW0Q0hSA1laHck2q7Cm2NOYpbGDXqg==", "dependencies": { - "@kth/in-memory-cache": "^0.1.51", "@kth/log": "^4.0.5" } }, diff --git a/package.json b/package.json index 6765c811..884f7325 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@kth/kth-node-web-common": "^8.1.1", "@kth/kth-reactstrap": "^0.4.66", "@kth/log": "^4.0.7", - "@kth/monitor": "^3.0.31", + "@kth/monitor": "^4.1.1", "@kth/server": "^4.0.4", "@kth/session": "^3.0.8", "applicationinsights": "^2.7.3", diff --git a/server/controllers/systemCtrl.js b/server/controllers/systemCtrl.js index b39a1966..77666171 100644 --- a/server/controllers/systemCtrl.js +++ b/server/controllers/systemCtrl.js @@ -9,7 +9,7 @@ const errorHandler = require('@kth/kth-node-web-common/lib/error') const { getPaths } = require('kth-node-express-routing') const language = require('@kth/kth-node-web-common/lib/language') const log = require('@kth/log') -const monitorSystems = require('@kth/monitor') +const { monitorRequest } = require('@kth/monitor') const redis = require('kth-node-redis') const version = require('../../config/version') const i18n = require('../../i18n') @@ -145,7 +145,7 @@ function _about(req, res) { async function _monitor(req, res) { try { const apiConfig = config.nodeApi - await monitorSystems(req, res, [ + await monitorRequest(req, res, [ ...(api ? Object.keys(api).map(apiKey => ({ key: apiKey, @@ -159,16 +159,6 @@ async function _monitor(req, res) { redis, options: config.session.redisOptions, }, - // If we need local system checks, such as memory or disk, we would add it here. - // Make sure it returns an object containing: - // {key: 'local', isResolved: true, statusCode: ###, message: '...'} - // The property statusCode should be standard HTTP status codes. - { - key: 'local', - isResolved: true, - message: '- local system checks: OK', - statusCode: 200, - }, ]) } catch (error) { log.error('Monitor failed', error)