diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433043136-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433043136-MigrationName.ts index 14ac84de46..f8eb265ba4 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433043136-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433043136-MigrationName.ts @@ -1,14 +1,17 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1731433043136 implements MigrationInterface { - public name = 'MigrationName1731433043136' + public name = "MigrationName1731433043136"; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`DROP INDEX "public"."IDX_5218e92f700d91afe6a8db79cb"`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE INDEX "IDX_5218e92f700d91afe6a8db79cb" ON "Incident" ("rootCause") `); - } + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `DROP INDEX "public"."IDX_5218e92f700d91afe6a8db79cb"`, + ); + } + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE INDEX "IDX_5218e92f700d91afe6a8db79cb" ON "Incident" ("rootCause") `, + ); + } } diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433309124-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433309124-MigrationName.ts index d5a2cacfc2..55906f3924 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433309124-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433309124-MigrationName.ts @@ -1,14 +1,17 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1731433309124 implements MigrationInterface { - public name = 'MigrationName1731433309124' + public name = "MigrationName1731433309124"; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`DROP INDEX "public"."IDX_fc40ea6a9ad55f29bca4f4a15d"`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE INDEX "IDX_fc40ea6a9ad55f29bca4f4a15d" ON "Alert" ("rootCause") `); - } + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `DROP INDEX "public"."IDX_fc40ea6a9ad55f29bca4f4a15d"`, + ); + } + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE INDEX "IDX_fc40ea6a9ad55f29bca4f4a15d" ON "Alert" ("rootCause") `, + ); + } } diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts index 72546773ec..8249bcae20 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts @@ -163,5 +163,5 @@ export default [ MigrationName1730209089495, MigrationName1730223198692, MigrationName1731433043136, - MigrationName1731433309124 + MigrationName1731433309124, ]; diff --git a/Common/Server/Utils/Monitor/MonitorIncident.ts b/Common/Server/Utils/Monitor/MonitorIncident.ts index 3eb81f86f1..073da331f4 100644 --- a/Common/Server/Utils/Monitor/MonitorIncident.ts +++ b/Common/Server/Utils/Monitor/MonitorIncident.ts @@ -129,10 +129,6 @@ export default class MonitorIncident { continue; } - // create incident here. - - debugger; - logger.debug(`${input.monitor.id?.toString()} - Create incident.`); const incident: Incident = new Incident(); diff --git a/Common/Server/Utils/Monitor/MonitorResource.ts b/Common/Server/Utils/Monitor/MonitorResource.ts index 12e71341fc..0fa67d1c18 100644 --- a/Common/Server/Utils/Monitor/MonitorResource.ts +++ b/Common/Server/Utils/Monitor/MonitorResource.ts @@ -143,7 +143,8 @@ export default class MonitorResourceUtil { // get last log. We do this because there are many monitoring steps and we need to store those. logger.debug( - `${dataToProcess.monitorId.toString()} - monitor type ${monitor.monitorType + `${dataToProcess.monitorId.toString()} - monitor type ${ + monitor.monitorType }`, ); @@ -309,7 +310,7 @@ export default class MonitorResourceUtil { if (incidentTemplate.autoResolveIncident) { if ( !autoResolveCriteriaInstanceIdIncidentIdsDictionary[ - criteriaInstance.data.id.toString() + criteriaInstance.data.id.toString() ] ) { autoResolveCriteriaInstanceIdIncidentIdsDictionary[ @@ -345,7 +346,7 @@ export default class MonitorResourceUtil { if (alertTemplate.autoResolveAlert) { if ( !autoResolveCriteriaInstanceIdAlertIdsDictionary[ - criteriaInstance.data.id.toString() + criteriaInstance.data.id.toString() ] ) { autoResolveCriteriaInstanceIdAlertIdsDictionary[ @@ -415,11 +416,13 @@ export default class MonitorResourceUtil { if (response.criteriaMetId && response.rootCause) { logger.debug( - `${dataToProcess.monitorId.toString()} - Criteria met: ${response.criteriaMetId + `${dataToProcess.monitorId.toString()} - Criteria met: ${ + response.criteriaMetId }`, ); logger.debug( - `${dataToProcess.monitorId.toString()} - Root cause: ${response.rootCause + `${dataToProcess.monitorId.toString()} - Root cause: ${ + response.rootCause }`, ); @@ -480,7 +483,7 @@ export default class MonitorResourceUtil { !response.criteriaMetId && monitorSteps.data.defaultMonitorStatusId && monitor.currentMonitorStatusId?.toString() !== - monitorSteps.data.defaultMonitorStatusId.toString() + monitorSteps.data.defaultMonitorStatusId.toString() ) { logger.debug( `${dataToProcess.monitorId.toString()} - No criteria met. Change to default status.`, @@ -517,7 +520,7 @@ export default class MonitorResourceUtil { lastMonitorStatusTimeline && lastMonitorStatusTimeline.monitorStatusId && lastMonitorStatusTimeline.monitorStatusId.toString() === - monitorSteps.data.defaultMonitorStatusId.toString() + monitorSteps.data.defaultMonitorStatusId.toString() ) { // status is same as last status. do not create new status timeline. // do nothing! status is same as last status. @@ -954,7 +957,6 @@ export default class MonitorResourceUtil { probeApiIngestResponse: ProbeApiIngestResponse; criteriaInstance: MonitorCriteriaInstance; }): Promise { - // returns root cause if any. Otherwise criteria is not met. let finalResult: string | null = "All filters met. "; @@ -1018,7 +1020,6 @@ export default class MonitorResourceUtil { }); if (screenshotInBase64) { - finalResult += ` **Screenshot**: