Monitor the health-check endpoint
MODIFY
src/server/ExpressUtils.ts
src/server/ExpressUtils.ts
@@ -7,6 +7,7 @@ import Utils from '../utils/Utils';
import bodyParser from 'body-parser';
import bodyParserXml from 'body-parser-xml';
import cors from 'cors';
+import global from '../types/GlobalType';
import helmet from 'helmet';
import hpp from 'hpp';
import locale from 'locale';

MODIFY
src/storage/mongodb/MongoDBStorage.ts
src/storage/mongodb/MongoDBStorage.ts
@@ -284,6 +284,7 @@ export default class MongoDBStorage {
public async ping(): Promise<boolean> {
if (this.database) {
+ const startTime = Logging.traceDatabaseRequestStart();
try {
const result = await this.database.command({ ping: 1 });
return (result.ok === 1);
@@ -297,6 +298,8 @@ export default class MongoDBStorage {
message, detailedMessages: { error: error.stack }
});
return false;
+ } finally {
+ await Logging.traceDatabaseRequestEnd(Constants.DEFAULT_TENANT_OBJECT, MODULE_NAME, 'ping', startTime, {});
}
}
return true;

MODIFY
src/utils/Constants.ts
src/utils/Constants.ts
@@ -50,7 +50,8 @@ export default class Constants {
public static readonly DEFAULT_TENANT = 'default';
public static readonly DEFAULT_TENANT_OBJECT = Object.freeze({
id: Constants.DEFAULT_TENANT,
- name: Constants.DEFAULT_TENANT
+ name: Constants.DEFAULT_TENANT,
+ subdomain: Constants.DEFAULT_TENANT
} as Tenant);
// Output of crypto.getCiphers()

Monitor the health-check endpoint