diff --git a/Common/Server/API/BaseAPI.ts b/Common/Server/API/BaseAPI.ts index 4464bb278f..f4554b8fba 100644 --- a/Common/Server/API/BaseAPI.ts +++ b/Common/Server/API/BaseAPI.ts @@ -196,6 +196,7 @@ export default class BaseAPI< this.service = service; } + @CaptureSpan() public async getPermissionsForTenant( req: ExpressRequest, ): Promise> { @@ -226,6 +227,7 @@ export default class BaseAPI< return null; } + @CaptureSpan() public async getList( req: ExpressRequest, res: ExpressResponse, @@ -302,6 +304,7 @@ export default class BaseAPI< ); } + @CaptureSpan() public async count(req: ExpressRequest, res: ExpressResponse): Promise { let query: Query = {}; @@ -324,6 +327,7 @@ export default class BaseAPI< }); } + @CaptureSpan() public async getItem( req: ExpressRequest, res: ExpressResponse, @@ -347,6 +351,7 @@ export default class BaseAPI< return Response.sendEntityResponse(req, res, item, this.entityType); } + @CaptureSpan() public async deleteItem( req: ExpressRequest, res: ExpressResponse, @@ -362,6 +367,7 @@ export default class BaseAPI< return Response.sendEmptySuccessResponse(req, res); } + @CaptureSpan() public async updateItem( req: ExpressRequest, res: ExpressResponse, @@ -388,6 +394,7 @@ export default class BaseAPI< return Response.sendEmptySuccessResponse(req, res); } + @CaptureSpan() public async createItem( req: ExpressRequest, res: ExpressResponse, diff --git a/Common/Server/API/BaseAnalyticsAPI.ts b/Common/Server/API/BaseAnalyticsAPI.ts index eba73a4a74..47883527b6 100644 --- a/Common/Server/API/BaseAnalyticsAPI.ts +++ b/Common/Server/API/BaseAnalyticsAPI.ts @@ -178,6 +178,7 @@ export default class BaseAnalyticsAPI< this.service = service; } + @CaptureSpan() public async getPermissionsForTenant( req: ExpressRequest, ): Promise> { @@ -208,6 +209,7 @@ export default class BaseAnalyticsAPI< return null; } + @CaptureSpan() public async getList( req: ExpressRequest, res: ExpressResponse, @@ -277,6 +279,7 @@ export default class BaseAnalyticsAPI< ); } + @CaptureSpan() public async getAggregate( req: ExpressRequest, res: ExpressResponse, @@ -319,6 +322,7 @@ export default class BaseAnalyticsAPI< }); } + @CaptureSpan() public async count(req: ExpressRequest, res: ExpressResponse): Promise { let query: Query = {}; @@ -341,6 +345,7 @@ export default class BaseAnalyticsAPI< }); } + @CaptureSpan() public async getItem( req: ExpressRequest, res: ExpressResponse, @@ -364,6 +369,7 @@ export default class BaseAnalyticsAPI< return Response.sendEntityResponse(req, res, item, this.entityType); } + @CaptureSpan() public async deleteItem( req: ExpressRequest, res: ExpressResponse, @@ -381,6 +387,7 @@ export default class BaseAnalyticsAPI< return Response.sendEmptySuccessResponse(req, res); } + @CaptureSpan() public async updateItem( req: ExpressRequest, res: ExpressResponse, @@ -411,6 +418,7 @@ export default class BaseAnalyticsAPI< return Response.sendEmptySuccessResponse(req, res); } + @CaptureSpan() public async createItem( req: ExpressRequest, res: ExpressResponse, diff --git a/Common/Server/API/StatusPageAPI.ts b/Common/Server/API/StatusPageAPI.ts index 0e241d9fc4..29670b3f0c 100644 --- a/Common/Server/API/StatusPageAPI.ts +++ b/Common/Server/API/StatusPageAPI.ts @@ -1505,6 +1505,7 @@ export default class StatusPageAPI extends BaseAPI< ); } + @CaptureSpan() public async getScheduledMaintenanceEvents( statusPageId: ObjectID, scheduledMaintenanceId: ObjectID | null, @@ -1822,6 +1823,7 @@ export default class StatusPageAPI extends BaseAPI< return response; } + @CaptureSpan() public async getAnnouncements( statusPageId: ObjectID, announcementId: ObjectID | null, @@ -1937,6 +1939,7 @@ export default class StatusPageAPI extends BaseAPI< return response; } + @CaptureSpan() public async subscribeToStatusPage(req: ExpressRequest): Promise { const objectId: ObjectID = new ObjectID( req.params["statusPageId"] as string, @@ -2163,6 +2166,7 @@ export default class StatusPageAPI extends BaseAPI< ); } + @CaptureSpan() public async getSubscriber( req: ExpressRequest, ): Promise { @@ -2229,6 +2233,7 @@ export default class StatusPageAPI extends BaseAPI< return statusPageSubscriber; } + @CaptureSpan() public async getIncidents( statusPageId: ObjectID, incidentId: ObjectID | null, @@ -2539,6 +2544,7 @@ export default class StatusPageAPI extends BaseAPI< return currentStatus; } + @CaptureSpan() public async getStatusPageResourcesAndTimelines(data: { statusPageId: ObjectID; startDateForMonitorTimeline: Date; diff --git a/Common/Server/Infrastructure/ClickhouseDatabase.ts b/Common/Server/Infrastructure/ClickhouseDatabase.ts index 75f873422e..10c628df51 100644 --- a/Common/Server/Infrastructure/ClickhouseDatabase.ts +++ b/Common/Server/Infrastructure/ClickhouseDatabase.ts @@ -34,6 +34,7 @@ export default class ClickhouseDatabase { return Boolean(this.dataSource); } + @CaptureSpan() public async connect( dataSourceOptions: ClickHouseClientConfigOptions, ): Promise { @@ -95,6 +96,7 @@ export default class ClickhouseDatabase { } } + @CaptureSpan() public async disconnect(): Promise { if (this.dataSource) { await this.dataSource.close(); @@ -102,6 +104,7 @@ export default class ClickhouseDatabase { } } + @CaptureSpan() public async checkConnnectionStatus(): Promise { // Ping clickhouse to check if the connection is still alive try { diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717605043663-InitialMigration.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717605043663-InitialMigration.ts index 40be89368f..d36abd6d7b 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717605043663-InitialMigration.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717605043663-InitialMigration.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner, Table } from "typeorm"; export default class InitialMigration implements MigrationInterface { public name: string = "InitialMigration1717605043663"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { // check if File table already exists, then dont run the migration const fileTable: Table | undefined = await queryRunner.getTable("File"); @@ -2776,6 +2777,7 @@ export default class InitialMigration implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "WorkflowLabel" DROP CONSTRAINT "FK_4e72fad380eca9abfa3b9895546"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717678334852-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717678334852-MigrationName.ts index 8b72e468e7..89c824fa26 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717678334852-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717678334852-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner, Table, TableColumn } from "typeorm"; export class MigrationName1717678334852 implements MigrationInterface { public name: string = "MigrationName1717678334852"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { // check if the column exists @@ -41,6 +42,7 @@ export class MigrationName1717678334852 implements MigrationInterface { } } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "TeamPermission" DROP COLUMN "isBlockPermission"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717839110671-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717839110671-MigrationName.ts index 2f091c48cb..605155f648 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717839110671-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717839110671-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1717839110671 implements MigrationInterface { public name = "MigrationName1717839110671"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "ServiceCatalog" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "name" character varying(100) NOT NULL, "slug" character varying(100) NOT NULL, "description" character varying(500), "createdByUserId" uuid, "deletedByUserId" uuid, "serviceColor" character varying, CONSTRAINT "PK_5186d54b1b97610ea80b5c55aad" PRIMARY KEY ("_id"))`, @@ -36,6 +37,7 @@ export class MigrationName1717839110671 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceCatalogLabel" DROP CONSTRAINT "FK_701f84e45404bdddcffdcaaba20"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717849921874-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717849921874-MigrationName.ts index 74de35a271..0b5ce996f8 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717849921874-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717849921874-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1717849921874 implements MigrationInterface { public name = "MigrationName1717849921874"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "ServiceCatalogOwnerTeam" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "teamId" uuid NOT NULL, "serviceCatalogId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_da84693caf7072d56bedfc2dc1b" PRIMARY KEY ("_id"))`, @@ -60,6 +61,7 @@ export class MigrationName1717849921874 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceCatalogOwnerUser" DROP CONSTRAINT "FK_d61607e823057b6516f05e8f1cd"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717955235341-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717955235341-MigrationName.ts index da83bea2b8..b8697a319f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717955235341-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1717955235341-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1717955235341 implements MigrationInterface { public name = "MigrationName1717955235341"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "CodeRepository" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "name" character varying(100) NOT NULL, "slug" character varying(100) NOT NULL, "description" character varying(500), "createdByUserId" uuid, "deletedByUserId" uuid, "secretToken" uuid NOT NULL, CONSTRAINT "PK_7b5219d06a82fbc0bc4540b74f0" PRIMARY KEY ("_id"))`, @@ -39,6 +40,7 @@ export class MigrationName1717955235341 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CodeRepositoryLabel" DROP CONSTRAINT "FK_8f7d12100e441fc72e02151fc56"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718037833516-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718037833516-MigrationName.ts index 9ee8c11058..add5f2ea63 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718037833516-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718037833516-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718037833516 implements MigrationInterface { public name = "MigrationName1718037833516"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "CopilotEvent" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "codeRepositoryId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "filePath" character varying NOT NULL, "commitHash" character varying NOT NULL, "copilotEventType" character varying NOT NULL, CONSTRAINT "PK_df9ab694204304a1416a720bbfc" PRIMARY KEY ("_id"))`, @@ -27,6 +28,7 @@ export class MigrationName1718037833516 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotEvent" DROP CONSTRAINT "FK_81c5f57878dd2230d2eec3bcb44"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718100824584-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718100824584-MigrationName.ts index 40fdcdc87b..4353d12b9c 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718100824584-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718100824584-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718100824584 implements MigrationInterface { public name = "MigrationName1718100824584"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageSubscriber" ADD "sendYouHaveSubscribedMessage" boolean NOT NULL DEFAULT true`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718101665865-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718101665865-MigrationName.ts index 8b9ff09f44..3b587a96b7 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718101665865-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718101665865-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718101665865 implements MigrationInterface { public name = "MigrationName1718101665865"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "SmsLog" ALTER COLUMN "fromNumber" DROP NOT NULL`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "SmsLog" ALTER COLUMN "fromNumber" SET NOT NULL`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718119926223-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718119926223-MigrationName.ts index e2c796828c..ba489781d7 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718119926223-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718119926223-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718119926223 implements MigrationInterface { public name = "MigrationName1718119926223"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceCatalog" ADD "serviceLanguage" character varying(100)`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceCatalog" DROP COLUMN "serviceLanguage"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718124277321-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718124277321-MigrationName.ts index e9532e115d..ab39b46610 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718124277321-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718124277321-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718124277321 implements MigrationInterface { public name = "MigrationName1718124277321"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "ServiceRepository" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "servicePathInRepository" character varying(500) NOT NULL DEFAULT '/', "limitNumberOfOpenPullRequestsCount" integer DEFAULT '3', "createdByUserId" uuid, "deletedByUserId" uuid, "codeRepositoryId" uuid NOT NULL, "serviceCatalogId" uuid NOT NULL, CONSTRAINT "PK_364ee8145cc35d43da0ef95d232" PRIMARY KEY ("_id"))`, @@ -51,6 +52,7 @@ export class MigrationName1718124277321 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotEvent" DROP CONSTRAINT "FK_b567d8c08ac3810e87efc3222c5"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718126316684-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718126316684-MigrationName.ts index 96e1d083d4..325fb74dc6 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718126316684-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718126316684-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718126316684 implements MigrationInterface { public name = "MigrationName1718126316684"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceRepository" ADD "enablePullRequests" boolean NOT NULL DEFAULT true`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceRepository" DROP COLUMN "enablePullRequests"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718188920011-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718188920011-MigrationName.ts index b508a9dfde..3b16b67197 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718188920011-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718188920011-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718188920011 implements MigrationInterface { public name = "MigrationName1718188920011"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CodeRepository" ADD "mainBranchName" character varying(100) NOT NULL DEFAULT 'master'`, @@ -12,6 +13,7 @@ export class MigrationName1718188920011 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CodeRepository" DROP COLUMN "repositoryHostedAt"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718203144945-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718203144945-MigrationName.ts index f832358407..e81488ecb3 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718203144945-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718203144945-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718203144945 implements MigrationInterface { public name = "MigrationName1718203144945"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CodeRepository" ADD "organizationName" character varying(100) NOT NULL`, @@ -12,6 +13,7 @@ export class MigrationName1718203144945 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CodeRepository" DROP COLUMN "repositoryName"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718285877004-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718285877004-MigrationName.ts index 8aca05030d..1a4c678df1 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718285877004-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718285877004-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718285877004 implements MigrationInterface { public name = "MigrationName1718285877004"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotEvent" ADD "pullRequestId" character varying`, @@ -12,6 +13,7 @@ export class MigrationName1718285877004 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotEvent" DROP COLUMN "copilotEventStatus"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718618155447-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718618155447-MigrationName.ts index f750422257..d457b756de 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718618155447-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718618155447-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718618155447 implements MigrationInterface { public name = "MigrationName1718618155447"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" ADD "subscriberTimezones" jsonb`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP COLUMN "subscriberTimezones"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718711669847-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718711669847-MigrationName.ts index e53fabd4fa..40992e0193 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718711669847-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718711669847-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718711669847 implements MigrationInterface { public name = "MigrationName1718711669847"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" ADD "remediationNotes" text`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" DROP COLUMN "remediationNotes"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718879960254-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718879960254-MigrationName.ts index 6ca6a538b0..5f66dc3791 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718879960254-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1718879960254-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1718879960254 implements MigrationInterface { public name = "MigrationName1718879960254"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "CopilotAction" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "codeRepositoryId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "filePath" character varying NOT NULL, "commitHash" character varying NOT NULL, "copilotActionType" character varying NOT NULL, "serviceCatalogId" uuid NOT NULL, "serviceRepositoryId" uuid NOT NULL, "pullRequestId" character varying, "copilotActionStatus" character varying NOT NULL, CONSTRAINT "PK_1a2ad3762ca1616c1f31c04ef1e" PRIMARY KEY ("_id"))`, @@ -39,6 +40,7 @@ export class MigrationName1718879960254 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" DROP CONSTRAINT "FK_786400c4dce05f85bbbd5244249"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719227548476-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719227548476-MigrationName.ts index 52dfa8c835..c73670f0df 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719227548476-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719227548476-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1719227548476 implements MigrationInterface { public name = "MigrationName1719227548476"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Project" ADD "enterpriseAnnualContractValue" character varying(100)`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Project" DROP COLUMN "enterpriseAnnualContractValue"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719228104620-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719228104620-MigrationName.ts index 7264455b02..eb33efdc0b 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719228104620-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719228104620-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1719228104620 implements MigrationInterface { public name = "MigrationName1719228104620"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { const doesTableExist: boolean = await queryRunner.hasTable("CopilotEvent"); if (doesTableExist) { @@ -10,6 +11,7 @@ export class MigrationName1719228104620 implements MigrationInterface { } } + @CaptureSpan() public async down(_queryRunner: QueryRunner): Promise { // we dont use this table anymore. } diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719247426296-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719247426296-MigrationName.ts index 5234e9e7cf..59eae86881 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719247426296-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719247426296-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1719247426296 implements MigrationInterface { public name = "MigrationName1719247426296"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Project" DROP COLUMN "enterpriseAnnualContractValue"`, @@ -12,6 +13,7 @@ export class MigrationName1719247426296 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Project" DROP COLUMN "enterpriseAnnualContractValue"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719348009053-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719348009053-MigrationName.ts index d2d7135022..effbebdb2f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719348009053-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719348009053-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1719348009053 implements MigrationInterface { public name = "MigrationName1719348009053"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Project" ADD "letCustomerSupportAccessProject" boolean DEFAULT false`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Project" DROP COLUMN "letCustomerSupportAccessProject"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719827175832-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719827175832-MigrationName.ts index 6f112dac41..0fed66c0c4 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719827175832-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719827175832-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1719827175832 implements MigrationInterface { public name = "MigrationName1719827175832"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Probe" ADD "connectionStatus" character varying`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Probe" DROP COLUMN "connectionStatus"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719831213463-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719831213463-MigrationName.ts index 6dcb4a9a2f..fd6129cfbc 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719831213463-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719831213463-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1719831213463 implements MigrationInterface { public name = "MigrationName1719831213463"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Monitor" ADD "isAllProbesDisconnectedFromThisMonitor" boolean DEFAULT false`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Monitor" DROP COLUMN "isAllProbesDisconnectedFromThisMonitor"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719838746775-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719838746775-MigrationName.ts index cb0bddca27..d89871f185 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719838746775-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719838746775-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1719838746775 implements MigrationInterface { public name = "MigrationName1719838746775"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "ProbeOwnerTeam" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "teamId" uuid NOT NULL, "probeId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "isOwnerNotified" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_b33e4c1d912b244680e0bace977" PRIMARY KEY ("_id"))`, @@ -81,6 +82,7 @@ export class MigrationName1719838746775 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ProbeLabel" DROP CONSTRAINT "FK_ab7fd85397d8c70c77c761004d2"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719915433542-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719915433542-MigrationName.ts index f9525d5025..693005a26d 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719915433542-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1719915433542-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1719915433542 implements MigrationInterface { public name = "MigrationName1719915433542"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Monitor" ADD "isNoProbeEnabledOnThisMonitor" boolean DEFAULT false`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Monitor" DROP COLUMN "isNoProbeEnabledOnThisMonitor"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720024126646-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720024126646-MigrationName.ts index 9d91a5932c..d8cf8c4fca 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720024126646-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720024126646-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1720024126646 implements MigrationInterface { public name = "MigrationName1720024126646"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { // change type of secretValue from varchar to text await queryRunner.query( @@ -10,6 +11,7 @@ export class MigrationName1720024126646 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "MonitorSecret" ALTER COLUMN "secretValue" TYPE character varying(500)`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720532068612-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720532068612-MigrationName.ts index dfac2ee8de..e644f29b5b 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720532068612-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720532068612-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1720532068612 implements MigrationInterface { public name = "MigrationName1720532068612"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { // delete all records from CopilotAction await queryRunner.query(`DELETE FROM "CopilotAction"`); @@ -82,6 +83,7 @@ export class MigrationName1720532068612 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotCodeRepositoryLabel" DROP CONSTRAINT "FK_d3bb0fc11b6e3b7fd3ca0464c15"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720538999941-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720538999941-MigrationName.ts index 7cd4545b38..e6097bb63c 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720538999941-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720538999941-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1720538999941 implements MigrationInterface { public name = "MigrationName1720538999941"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotCodeRepository" DROP COLUMN "onBeforeRepositoryCloneScript"`, @@ -18,6 +19,7 @@ export class MigrationName1720538999941 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotCodeRepository" ADD "onBeforeCommitScript" text`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720785305192-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720785305192-MigrationName.ts index 5a899276ac..90625f54ff 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720785305192-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720785305192-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1720785305192 implements MigrationInterface { public name = "MigrationName1720785305192"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { // delete all data from CopilotAction await queryRunner.query(`DELETE FROM "CopilotAction"`); @@ -60,6 +61,7 @@ export class MigrationName1720785305192 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" DROP CONSTRAINT "FK_c21417d854c9330f4cadc2bc2b0"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720805596648-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720805596648-MigrationName.ts index 6d7c0b57ac..2ac7e939cd 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720805596648-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720805596648-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1720805596648 implements MigrationInterface { public name = "MigrationName1720805596648"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotPullRequest" ADD "isSetupPullRequest" boolean`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotPullRequest" DROP COLUMN "isSetupPullRequest"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720806196274-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720806196274-MigrationName.ts index 4d8e9a565f..65933da38e 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720806196274-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720806196274-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1720806196274 implements MigrationInterface { public name = "MigrationName1720806196274"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotPullRequest" DROP CONSTRAINT "FK_81c04dfb087fe1314f9b0bfbd0d"`, @@ -24,6 +25,7 @@ export class MigrationName1720806196274 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotPullRequest" DROP CONSTRAINT "FK_8e7cd28e052005c1098553f18df"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720812937067-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720812937067-MigrationName.ts index 3113064ae8..4366090221 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720812937067-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1720812937067-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1720812937067 implements MigrationInterface { public name = "MigrationName1720812937067"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" DROP CONSTRAINT "FK_c21417d854c9330f4cadc2bc2b0"`, @@ -15,6 +16,7 @@ export class MigrationName1720812937067 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" DROP CONSTRAINT "FK_c21417d854c9330f4cadc2bc2b0"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721075917289-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721075917289-MigrationName.ts index 92045d099f..9a13c26f83 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721075917289-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721075917289-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1721075917289 implements MigrationInterface { public name = "MigrationName1721075917289"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "ServiceCatlogDependency" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "serviceCatalogId" uuid NOT NULL, "dependencyServiceCatalogId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_f4c8003faa6daec34a5b97f88e8" PRIMARY KEY ("_id"))`, @@ -33,6 +34,7 @@ export class MigrationName1721075917289 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceCatlogDependency" DROP CONSTRAINT "FK_a4e505f3feab672e2dbbb3a58a1"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721152139648-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721152139648-MigrationName.ts index 5673e534fb..ca7181558b 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721152139648-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721152139648-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1721152139648 implements MigrationInterface { public name = "MigrationName1721152139648"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "ServiceCatalogMonitor" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "serviceCatalogId" uuid NOT NULL, "monitorId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_194c766475d9a575a17c16bb7b9" PRIMARY KEY ("_id"))`, @@ -60,6 +61,7 @@ export class MigrationName1721152139648 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceCatalogTelemetryService" DROP CONSTRAINT "FK_b0419b3b36e6606a404eb97a98a"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721159743714-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721159743714-MigrationName.ts index d28e6c1e33..46480815d6 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721159743714-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721159743714-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1721159743714 implements MigrationInterface { public name = "MigrationName1721159743714"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceCatalog" ADD "techStack" jsonb`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ServiceCatalog" DROP COLUMN "techStack"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721754545771-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721754545771-MigrationName.ts index 1fe855a51f..b2b00b55ad 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721754545771-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721754545771-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1721754545771 implements MigrationInterface { public name = "MigrationName1721754545771"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" ADD "isReportEnabled" boolean NOT NULL DEFAULT false`, @@ -18,6 +19,7 @@ export class MigrationName1721754545771 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP COLUMN "sendNextReportBy"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721779190475-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721779190475-MigrationName.ts index bfec14a134..de414ae63b 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721779190475-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1721779190475-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1721779190475 implements MigrationInterface { public name = "MigrationName1721779190475"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" ADD "reportDataInDays" integer DEFAULT '30'`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP COLUMN "reportDataInDays"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722031205897-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722031205897-MigrationName.ts index c907c32ca3..878050e45f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722031205897-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722031205897-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1722031205897 implements MigrationInterface { public name = "MigrationName1722031205897"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "UserTwoFactorAuth" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "name" character varying(100) NOT NULL, "twoFactorSecret" text NOT NULL, "twoFactorOtpUrl" text NOT NULL, "isVerified" boolean NOT NULL DEFAULT false, "deletedByUserId" uuid, "userId" uuid, CONSTRAINT "PK_1e248beb4011dcab4bd5ca73fc1" PRIMARY KEY ("_id"))`, @@ -18,6 +19,7 @@ export class MigrationName1722031205897 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "UserTwoFactorAuth" DROP CONSTRAINT "FK_3a7c46ce8b2f60e0801a0aaeaa2"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722543640526-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722543640526-MigrationName.ts index 8cd09ab4fb..ab0ccf81b7 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722543640526-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722543640526-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1722543640526 implements MigrationInterface { public name = "MigrationName1722543640526"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "TelemetryIngestionKey" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "name" character varying(100) NOT NULL, "description" character varying(500), "createdByUserId" uuid, "deletedByUserId" uuid, "secretKey" uuid NOT NULL, CONSTRAINT "PK_57133851c3817251c983a378342" PRIMARY KEY ("_id"))`, @@ -27,6 +28,7 @@ export class MigrationName1722543640526 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "TelemetryIngestionKey" DROP CONSTRAINT "FK_2874c193beda1ef2e841cbbfba4"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722892318363-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722892318363-MigrationName.ts index 56f5361239..4faeb2dd48 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722892318363-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1722892318363-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1722892318363 implements MigrationInterface { public name = "MigrationName1722892318363"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Monitor" ADD "telemetryMonitorNextMonitorAt" TIMESTAMP WITH TIME ZONE`, @@ -21,6 +22,7 @@ export class MigrationName1722892318363 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_02bae6cdc6d5b3092ac393fbb3"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1723825511054-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1723825511054-MigrationName.ts index 80fafb3eb9..dd330dd870 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1723825511054-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1723825511054-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1723825511054 implements MigrationInterface { public name = "MigrationName1723825511054"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" ADD "showOverallUptimePercentOnStatusPage" boolean NOT NULL DEFAULT false`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP COLUMN "showOverallUptimePercentOnStatusPage"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1723828588502-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1723828588502-MigrationName.ts index d972054b1d..5c5113cb69 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1723828588502-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1723828588502-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1723828588502 implements MigrationInterface { public name = "MigrationName1723828588502"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" ADD "overallUptimePercentPrecision" character varying DEFAULT '99.99% (Two Decimal)'`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP COLUMN "overallUptimePercentPrecision"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724078044172-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724078044172-MigrationName.ts index ad5d03b6e6..b44511495f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724078044172-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724078044172-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1724078044172 implements MigrationInterface { public name = "MigrationName1724078044172"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Monitor" ADD "incomingRequestMonitorHeartbeatCheckedAt" TIMESTAMP WITH TIME ZONE`, @@ -12,6 +13,7 @@ export class MigrationName1724078044172 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_62cf90e5fbcd9f3742ed35a2bb"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724610006927-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724610006927-MigrationName.ts index d24924c514..f76130eb1a 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724610006927-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724610006927-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1724610006927 implements MigrationInterface { public name = "MigrationName1724610006927"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "TelemetryException" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "telemetryServiceId" uuid NOT NULL, "message" character varying, "stackTrace" character varying, "exceptionType" character varying, "fingerprint" character varying(100), "createdByUserId" uuid, "deletedByUserId" uuid, "markedAsResolvedAt" TIMESTAMP WITH TIME ZONE, "markedAsMutedAt" TIMESTAMP WITH TIME ZONE, "firstSeenAt" TIMESTAMP WITH TIME ZONE, "lastSeenAt" TIMESTAMP WITH TIME ZONE, "assignToUserId" uuid, "assignToTeamId" uuid, "markedAsResolvedByUserId" uuid, "markedAsMutedByUserId" uuid, CONSTRAINT "PK_53717afe73c3e72c11713e5e25f" PRIMARY KEY ("_id"))`, @@ -48,6 +49,7 @@ export class MigrationName1724610006927 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "TelemetryException" DROP CONSTRAINT "FK_199e3572d19b75e59f2082251f8"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724613666632-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724613666632-MigrationName.ts index 2be83e76bb..cca1f6f49b 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724613666632-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724613666632-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1724613666632 implements MigrationInterface { public name = "MigrationName1724613666632"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "TelemetryException" DROP CONSTRAINT "FK_199e3572d19b75e59f2082251f8"`, @@ -31,6 +32,7 @@ export class MigrationName1724613666632 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "TelemetryException" DROP CONSTRAINT "FK_3def22373f0cb84e16cb355b5e5"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724659071843-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724659071843-MigrationName.ts index 43cc49cd44..acc6ddff14 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724659071843-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1724659071843-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1724659071843 implements MigrationInterface { public name = "MigrationName1724659071843"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "TelemetryException" ADD "occuranceCount" integer NOT NULL DEFAULT '1'`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "TelemetryException" DROP COLUMN "occuranceCount"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.ts index 7c47c13e52..4e2f9fd36a 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725291476867-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725291476867 implements MigrationInterface { public name = "MigrationName1725291476867"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "CopilotActionTypePriority" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "codeRepositoryId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "actionType" character varying(100) NOT NULL, "priority" integer NOT NULL DEFAULT '1', CONSTRAINT "PK_e87af58e75ac25610e48807703e" PRIMARY KEY ("_id"))`, @@ -27,6 +28,7 @@ export class MigrationName1725291476867 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotActionTypePriority" DROP CONSTRAINT "FK_01864ec4b8b5f343e484a09128a"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.ts index 023f9045f8..ac461929d1 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725357719072-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725357719072 implements MigrationInterface { public name = "MigrationName1725357719072"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" ADD "copilotActionProp" jsonb`, @@ -12,6 +13,7 @@ export class MigrationName1725357719072 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" DROP COLUMN "statusMessage"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.ts index b4edcede94..744027573c 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725360199561-MigrationName.ts @@ -3,10 +3,12 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725360199561 implements MigrationInterface { public name = "MigrationName1725360199561"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "CopilotAction" ADD "logs" text`); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "CopilotAction" DROP COLUMN "logs"`); } diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.ts index 76dbb6f612..31cd618bd8 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725379949648-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725379949648 implements MigrationInterface { public name = "MigrationName1725379949648"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" ADD "isPriority" boolean NOT NULL DEFAULT false`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" DROP COLUMN "isPriority"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725551629492-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725551629492-MigrationName.ts index 649a2cf7f5..33caa707f7 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725551629492-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725551629492-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725551629492 implements MigrationInterface { public name = "MigrationName1725551629492"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" DROP COLUMN "filePath"`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" ADD "filePath" character varying NOT NULL`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725556630384-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725556630384-MigrationName.ts index 6bcb2467de..29727b183a 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725556630384-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725556630384-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725556630384 implements MigrationInterface { public name = "MigrationName1725556630384"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "BillingInvoice" ADD "invoiceDate" TIMESTAMP WITH TIME ZONE`, @@ -15,6 +16,7 @@ export class MigrationName1725556630384 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "CopilotAction" DROP COLUMN "statusChangedAt"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725618842598-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725618842598-MigrationName.ts index 603ab05188..e8c868e0a6 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725618842598-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725618842598-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725618842598 implements MigrationInterface { public name = "MigrationName1725618842598"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageAnnouncement" ALTER COLUMN "endAnnouncementAt" DROP NOT NULL`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageAnnouncement" ALTER COLUMN "endAnnouncementAt" SET NOT NULL`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725880508430-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725880508430-MigrationName.ts index 5b3c5a8c01..e18b3b66f7 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725880508430-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725880508430-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725880508430 implements MigrationInterface { public name = "MigrationName1725880508430"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "ScheduledMaintenanceTemplate" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, "projectId" uuid NOT NULL, "title" character varying(100) NOT NULL, "description" text, "slug" character varying(100) NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "currentScheduledMaintenanceStateId" uuid NOT NULL, "changeMonitorStatusToId" uuid, "startsAt" TIMESTAMP WITH TIME ZONE NOT NULL, "endsAt" TIMESTAMP WITH TIME ZONE NOT NULL, "shouldStatusPageSubscribersBeNotifiedOnEventCreated" boolean NOT NULL DEFAULT true, "shouldStatusPageSubscribersBeNotifiedWhenEventChangedToOngoing" boolean NOT NULL DEFAULT true, "shouldStatusPageSubscribersBeNotifiedWhenEventChangedToEnded" boolean NOT NULL DEFAULT true, "customFields" jsonb, CONSTRAINT "UQ_389395798bdc01f66af7f579a93" UNIQUE ("slug"), CONSTRAINT "PK_92912fb2ee31a1d2912e0077b65" PRIMARY KEY ("_id"))`, @@ -138,6 +139,7 @@ export class MigrationName1725880508430 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplateLabel" DROP CONSTRAINT "FK_ac1b6389a147d1556e38de4bff2"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725881099935-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725881099935-MigrationName.ts index 92fb5c0eb6..9eca591c2f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725881099935-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725881099935-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725881099935 implements MigrationInterface { public name = "MigrationName1725881099935"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" ADD "recurringInterval" jsonb`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" DROP COLUMN "recurringInterval"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725881475134-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725881475134-MigrationName.ts index 8db1aea7af..2c34a177e6 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725881475134-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725881475134-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725881475134 implements MigrationInterface { public name = "MigrationName1725881475134"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" ADD "templateName" character varying(100) NOT NULL`, @@ -18,6 +19,7 @@ export class MigrationName1725881475134 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725884177663-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725884177663-MigrationName.ts index b16c34f57a..dedf464470 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725884177663-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725884177663-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725884177663 implements MigrationInterface { public name = "MigrationName1725884177663"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" DROP CONSTRAINT "FK_aea47be8b8af9673e9639e7dae3"`, @@ -15,6 +16,7 @@ export class MigrationName1725884177663 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" ADD "currentScheduledMaintenanceStateId" uuid NOT NULL`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725898621366-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725898621366-MigrationName.ts index 7f0d9e72b2..bfd6057f03 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725898621366-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725898621366-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725898621366 implements MigrationInterface { public name = "MigrationName1725898621366"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" ADD "isRecurringEvent" boolean NOT NULL DEFAULT false`, @@ -15,6 +16,7 @@ export class MigrationName1725898621366 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" ALTER COLUMN "endsAt" SET NOT NULL`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725900315712-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725900315712-MigrationName.ts index 8b02f60d8a..f6a1c338df 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725900315712-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725900315712-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725900315712 implements MigrationInterface { public name = "MigrationName1725900315712"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" DROP COLUMN "startsAt"`, @@ -30,6 +31,7 @@ export class MigrationName1725900315712 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725901024444-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725901024444-MigrationName.ts index eb729c059f..b98de6868a 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725901024444-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725901024444-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725901024444 implements MigrationInterface { public name = "MigrationName1725901024444"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" DROP COLUMN "scheduleNextEventAt"`, @@ -12,6 +13,7 @@ export class MigrationName1725901024444 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" DROP COLUMN "scheduleNextEventAt"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725975175669-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725975175669-MigrationName.ts index 2fde28b612..87304de94e 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725975175669-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725975175669-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725975175669 implements MigrationInterface { public name = "MigrationName1725975175669"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenance" ADD "sendSubscriberNotificationsOnBeforeTheEvent" jsonb`, @@ -15,6 +16,7 @@ export class MigrationName1725975175669 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_37b2094ce25cc62b4766a7d3b1"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725976810107-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725976810107-MigrationName.ts index e80259fc20..a18c801d68 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725976810107-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1725976810107-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1725976810107 implements MigrationInterface { public name = "MigrationName1725976810107"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" ADD "sendSubscriberNotificationsOnBeforeTheEvent" jsonb`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplate" DROP COLUMN "sendSubscriberNotificationsOnBeforeTheEvent"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1726831037585-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1726831037585-MigrationName.ts index 8adf506f50..726d5a7ffe 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1726831037585-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1726831037585-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1726831037585 implements MigrationInterface { public name = "MigrationName1726831037585"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageGroup" ADD "showCurrentStatus" boolean NOT NULL DEFAULT true`, @@ -15,6 +16,7 @@ export class MigrationName1726831037585 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageGroup" DROP COLUMN "uptimePercentPrecision"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727101782315-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727101782315-MigrationName.ts index 3a0106f2d7..b2eecbafd8 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727101782315-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727101782315-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727101782315 implements MigrationInterface { public name = "MigrationName1727101782315"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP CONSTRAINT "FK_61944d851b4a7213d79ef281744"`, @@ -12,6 +13,7 @@ export class MigrationName1727101782315 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP CONSTRAINT "FK_61944d851b4a7213d79ef281744"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727102156072-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727102156072-MigrationName.ts index 6e7b1dcd1c..0bb20095c1 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727102156072-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727102156072-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727102156072 implements MigrationInterface { public name = "MigrationName1727102156072"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP CONSTRAINT "FK_61944d851b4a7213d79ef281744"`, @@ -12,6 +13,7 @@ export class MigrationName1727102156072 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP CONSTRAINT "FK_61944d851b4a7213d79ef281744"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727102331367-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727102331367-MigrationName.ts index 4fba8c445d..f7fe5ca22f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727102331367-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727102331367-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727102331367 implements MigrationInterface { public name = "MigrationName1727102331367"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP CONSTRAINT "FK_61944d851b4a7213d79ef281744"`, @@ -12,6 +13,7 @@ export class MigrationName1727102331367 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP CONSTRAINT "FK_61944d851b4a7213d79ef281744"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727103023745-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727103023745-MigrationName.ts index a2d6aa1b7e..243672775e 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727103023745-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727103023745-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727103023745 implements MigrationInterface { public name = "MigrationName1727103023745"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "User" DROP CONSTRAINT "FK_644c3c0393979f57f71892ff0d7"`, @@ -1362,6 +1363,7 @@ export class MigrationName1727103023745 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceTemplateOwnerUser" DROP CONSTRAINT "FK_64da70a3e70ddc728b6b15659ca"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727104469670-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727104469670-MigrationName.ts index 9cd6ae3ea9..4735662e6e 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727104469670-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727104469670-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727104469670 implements MigrationInterface { public name = "MigrationName1727104469670"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP CONSTRAINT "FK_4e347d3f99b67dacd149beaf61d"`, @@ -18,6 +19,7 @@ export class MigrationName1727104469670 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP CONSTRAINT "FK_4e347d3f99b67dacd149beaf61d"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727192530019-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727192530019-MigrationName.ts index b056936786..a63795bbab 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727192530019-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727192530019-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727192530019 implements MigrationInterface { public name = "MigrationName1727192530019"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "File" ALTER COLUMN "createdAt" TYPE TIMESTAMP WITH TIME ZONE`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "File" ALTER COLUMN "createdAt" TYPE TIMESTAMP`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727193130193-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727193130193-MigrationName.ts index f4a95a8295..0678c4a936 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727193130193-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727193130193-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727193130193 implements MigrationInterface { public name = "MigrationName1727193130193"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "User" ALTER COLUMN "createdAt" TYPE TIMESTAMP WITH TIME ZONE`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "User" ALTER COLUMN "createdAt" TYPE TIMESTAMP`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727193702212-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727193702212-MigrationName.ts index d8f4cd3784..b8231a6dc8 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727193702212-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727193702212-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727193702212 implements MigrationInterface { public name = "MigrationName1727193702212"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "AcmeCertificate" ALTER COLUMN "createdAt" TYPE TIMESTAMP WITH TIME ZONE`, @@ -722,5 +723,6 @@ export class MigrationName1727193702212 implements MigrationInterface { ); } + @CaptureSpan() public async down(_queryRunner: QueryRunner): Promise {} } diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727194211048-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727194211048-MigrationName.ts index f3e84c1c45..c2b53ce06d 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727194211048-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727194211048-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727194211048 implements MigrationInterface { public name = "MigrationName1727194211048"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "User" ALTER COLUMN "updatedAt" TYPE TIMESTAMP WITH TIME ZONE`, @@ -728,5 +729,6 @@ export class MigrationName1727194211048 implements MigrationInterface { ); } + @CaptureSpan() public async down(_queryRunner: QueryRunner): Promise {} } diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727194579925-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727194579925-MigrationName.ts index e7dcaa28c8..a24ac30bd8 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727194579925-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727194579925-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727194579925 implements MigrationInterface { public name = "MigrationName1727194579925"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "User" ALTER COLUMN "deletedAt" TYPE TIMESTAMP WITH TIME ZONE`, @@ -489,5 +490,6 @@ export class MigrationName1727194579925 implements MigrationInterface { ); } + @CaptureSpan() public async down(_queryRunner: QueryRunner): Promise {} } diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727894983857-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727894983857-MigrationName.ts index 62e14fa33d..0681e11629 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727894983857-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727894983857-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727894983857 implements MigrationInterface { public name = "MigrationName1727894983857"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "TableView" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "name" character varying(100) NOT NULL, "tableId" character varying(100) NOT NULL, "description" character varying(500), "createdByUserId" uuid, "deletedByUserId" uuid, "query" jsonb NOT NULL, "sort" jsonb NOT NULL, "itemsOnPage" integer NOT NULL DEFAULT '10', CONSTRAINT "PK_1e17a8834a65403cc87c4ead0cc" PRIMARY KEY ("_id"))`, @@ -27,6 +28,7 @@ export class MigrationName1727894983857 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "TableView" DROP CONSTRAINT "FK_b36d769f3d3d6fe4f9c35984551"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727906598804-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727906598804-MigrationName.ts index b937e9d609..986b6cacce 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727906598804-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727906598804-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1727906598804 implements MigrationInterface { public name = "MigrationName1727906598804"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "AlertSeverity" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "name" character varying(100) NOT NULL, "slug" character varying(100) NOT NULL, "description" character varying(500), "createdByUserId" uuid, "deletedByUserId" uuid, "color" character varying(7) NOT NULL, "order" smallint NOT NULL, CONSTRAINT "PK_6ed0de1b0a2ea665f42e3599b0e" PRIMARY KEY ("_id"))`, @@ -288,6 +289,7 @@ export class MigrationName1727906598804 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "AlertLabel" DROP CONSTRAINT "FK_507fd32e297f0287df932d7550d"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1728472625805-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1728472625805-MigrationName.ts index 6624c113e6..e3fbbae4f3 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1728472625805-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1728472625805-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1728472625805 implements MigrationInterface { public name = "MigrationName1728472625805"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageDomain" ADD "customCertificate" text`, @@ -15,6 +16,7 @@ export class MigrationName1728472625805 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageDomain" DROP COLUMN "isCustomCertificate"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1729682875503-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1729682875503-MigrationName.ts index 79291d21cf..2779f9100f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1729682875503-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1729682875503-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1729682875503 implements MigrationInterface { public name = "MigrationName1729682875503"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "Dashboard" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "name" character varying(100) NOT NULL, "slug" character varying(100) NOT NULL, "description" character varying(500), "createdByUserId" uuid, "deletedByUserId" uuid, "dashboardViewConfig" jsonb NOT NULL, CONSTRAINT "PK_98ee748c8a7a18d6f9ca995eaf4" PRIMARY KEY ("_id"))`, @@ -42,6 +43,7 @@ export class MigrationName1729682875503 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "DashboardLabel" DROP CONSTRAINT "FK_31a32c8d6d1d1cb734c77110509"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730117995642-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730117995642-MigrationName.ts index da3bb431c2..41f98f5a44 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730117995642-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730117995642-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1730117995642 implements MigrationInterface { public name = "MigrationName1730117995642"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" ADD "allowSubscribersToChooseEventTypes" boolean NOT NULL DEFAULT false`, @@ -15,6 +16,7 @@ export class MigrationName1730117995642 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageSubscriber" DROP COLUMN "statusPageEventTypes"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730209089495-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730209089495-MigrationName.ts index d5078c428d..6f1de8f5c4 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730209089495-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730209089495-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1730209089495 implements MigrationInterface { public name = "MigrationName1730209089495"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "MonitorTest" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "monitorType" character varying(100) NOT NULL, "monitorSteps" jsonb, "probeId" uuid NOT NULL, "testedAt" TIMESTAMP WITH TIME ZONE, "lastMonitoringLog" jsonb, CONSTRAINT "PK_7ce3477c7bb3d7b8961c8465935" PRIMARY KEY ("_id"))`, @@ -27,6 +28,7 @@ export class MigrationName1730209089495 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "MonitorTest" DROP CONSTRAINT "FK_fd6b1e330eb08de988307b60524"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730223198692-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730223198692-MigrationName.ts index c488834ff2..4ad8870459 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730223198692-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1730223198692-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1730223198692 implements MigrationInterface { public name = "MigrationName1730223198692"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "MonitorTest" DROP COLUMN "lastMonitoringLog"`, @@ -15,6 +16,7 @@ export class MigrationName1730223198692 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "MonitorTest" DROP COLUMN "isInQueue"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433043136-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433043136-MigrationName.ts index f8eb265ba4..ca23a5069f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433043136-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433043136-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1731433043136 implements MigrationInterface { public name = "MigrationName1731433043136"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_5218e92f700d91afe6a8db79cb"`, ); } + @CaptureSpan() 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 55906f3924..fb78db2903 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433309124-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731433309124-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1731433309124 implements MigrationInterface { public name = "MigrationName1731433309124"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_fc40ea6a9ad55f29bca4f4a15d"`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_fc40ea6a9ad55f29bca4f4a15d" ON "Alert" ("rootCause") `, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731435267537-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731435267537-MigrationName.ts index 8b3e6b5cb2..07845b0776 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731435267537-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731435267537-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1731435267537 implements MigrationInterface { public name = "MigrationName1731435267537"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_01ac1d1ef9e72aeb6dac6575dd"`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_01ac1d1ef9e72aeb6dac6575dd" ON "MonitorStatusTimeline" ("rootCause") `, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731435514287-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731435514287-MigrationName.ts index f36d19c3fe..48b5729aa7 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731435514287-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1731435514287-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1731435514287 implements MigrationInterface { public name = "MigrationName1731435514287"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_7db6b1a8fbbc9eb44c2e7f5047"`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_7db6b1a8fbbc9eb44c2e7f5047" ON "IncidentStateTimeline" ("rootCause") `, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1732553444010-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1732553444010-MigrationName.ts index b7c2ee0f64..47a6eab894 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1732553444010-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1732553444010-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1732553444010 implements MigrationInterface { public name = "MigrationName1732553444010"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "TelemetryException" ALTER COLUMN "message" TYPE text`, @@ -15,6 +16,7 @@ export class MigrationName1732553444010 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { // revert changes made in up method - text to varchar await queryRunner.query( diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1734435866602-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1734435866602-MigrationName.ts index 92993364d0..e8ec913feb 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1734435866602-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1734435866602-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1734435866602 implements MigrationInterface { public name = "MigrationName1734435866602"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageSubscriber" ADD "isSubscriptionConfirmed" boolean NOT NULL DEFAULT false`, @@ -12,6 +13,7 @@ export class MigrationName1734435866602 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPageSubscriber" DROP COLUMN "subscriptionConfirmationToken"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736364478985-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736364478985-MigrationName.ts index db4995bdcb..01e03318a9 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736364478985-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736364478985-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736364478985 implements MigrationInterface { public name = "MigrationName1736364478985"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "IncidentLog" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "incidentId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "logInMarkdown" text NOT NULL, "moreInformationInMarkdown" text NOT NULL, "incidentLogEvent" character varying NOT NULL, CONSTRAINT "PK_947cb9f32cf204561d10d64adeb" PRIMARY KEY ("_id"))`, @@ -27,6 +28,7 @@ export class MigrationName1736364478985 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "IncidentLog" DROP CONSTRAINT "FK_bb1b8b83ffdfc702088b74f2e16"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736364957990-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736364957990-MigrationName.ts index 6e8def198f..c5a906ca18 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736364957990-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736364957990-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736364957990 implements MigrationInterface { public name = "MigrationName1736364957990"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "AlertLog" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "alertId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "logInMarkdown" text NOT NULL, "moreInformationInMarkdown" text NOT NULL, "alertLogEvent" character varying NOT NULL, CONSTRAINT "PK_500826238fa54528b0026f55d47" PRIMARY KEY ("_id"))`, @@ -33,6 +34,7 @@ export class MigrationName1736364957990 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "AlertLog" DROP CONSTRAINT "FK_7ca9046915f6de6e7a199588d26"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736365532085-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736365532085-MigrationName.ts index 6aaeebc826..301a3381de 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736365532085-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736365532085-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736365532085 implements MigrationInterface { public name = "MigrationName1736365532085"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "ScheduledMaintenanceLog" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "scheduledMaintenanceId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "logInMarkdown" text NOT NULL, "moreInformationInMarkdown" text NOT NULL, "scheduledMaintenanceLogEvent" character varying NOT NULL, CONSTRAINT "PK_27b89f28bf48418fabba9a1ea14" PRIMARY KEY ("_id"))`, @@ -27,6 +28,7 @@ export class MigrationName1736365532085 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceLog" DROP CONSTRAINT "FK_a957f435d1504f41808f20a2c45"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736675947746-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736675947746-MigrationName.ts index 3516ff4540..851eb1626d 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736675947746-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736675947746-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736675947746 implements MigrationInterface { public name = "MigrationName1736675947746"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" ADD "incidentNumber" integer`, @@ -12,6 +13,7 @@ export class MigrationName1736675947746 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_0eca9ce7d12a4c472386dfc781"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736703138918-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736703138918-MigrationName.ts index c27438f212..51e528229f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736703138918-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736703138918-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736703138918 implements MigrationInterface { public name = "MigrationName1736703138918"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "IncidentLog" ADD "incidentLogSeverity" character varying NOT NULL`, @@ -15,6 +16,7 @@ export class MigrationName1736703138918 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceLog" DROP COLUMN "scheduledMaintenanceLogSeverity"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736780194077-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736780194077-MigrationName.ts index f3f163daa6..a9f8950c46 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736780194077-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736780194077-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736780194077 implements MigrationInterface { public name = "MigrationName1736780194077"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "IncidentFeed" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "incidentId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "feedInfoInMarkdown" text NOT NULL, "moreInformationInMarkdown" text NOT NULL, "incidentFeedEventType" character varying NOT NULL, "displayColor" character varying(7) NOT NULL, CONSTRAINT "PK_8188c79d1ed22013205ff324dea" PRIMARY KEY ("_id"))`, @@ -69,6 +70,7 @@ export class MigrationName1736780194077 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceFeed" DROP CONSTRAINT "FK_8374052884c5d75f5018c1dc908"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736780194078-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736780194078-MigrationName.ts index 4bbdc4c48b..9a71fc4441 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736780194078-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736780194078-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736780194078 implements MigrationInterface { public name = "MigrationName1736780194078"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { // drop tables IncidentLog, AlertLog, ScheduledMaintenanceLog await queryRunner.query(`DROP TABLE "IncidentLog"`); @@ -10,6 +11,7 @@ export class MigrationName1736780194078 implements MigrationInterface { await queryRunner.query(`DROP TABLE "ScheduledMaintenanceLog"`); } + @CaptureSpan() public async down(_queryRunner: QueryRunner): Promise { // do nothing. } diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736787495707-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736787495707-MigrationName.ts index 7ebf97120c..8c6f4815b4 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736787495707-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736787495707-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736787495707 implements MigrationInterface { public name = "MigrationName1736787495707"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "IncidentFeed" ALTER COLUMN "moreInformationInMarkdown" DROP NOT NULL`, @@ -15,6 +16,7 @@ export class MigrationName1736787495707 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceFeed" ALTER COLUMN "moreInformationInMarkdown" SET NOT NULL`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736787985322-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736787985322-MigrationName.ts index fe922b4382..e754c7eab0 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736787985322-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736787985322-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736787985322 implements MigrationInterface { public name = "MigrationName1736787985322"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Label" ALTER COLUMN "color" TYPE character varying(10)`, @@ -42,6 +43,7 @@ export class MigrationName1736787985322 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Label" ALTER COLUMN "color" TYPE character varying(7)`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736788706141-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736788706141-MigrationName.ts index af0054f3f0..30b95d7eef 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736788706141-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736788706141-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736788706141 implements MigrationInterface { public name = "MigrationName1736788706141"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "IncidentFeed" ADD "userId" uuid`); await queryRunner.query(`ALTER TABLE "AlertFeed" ADD "userId" uuid`); @@ -20,6 +21,7 @@ export class MigrationName1736788706141 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceFeed" DROP CONSTRAINT "FK_541c2b40579cbf342c8850ced2b"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736856662868-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736856662868-MigrationName.ts index 9bd46f9aca..7ed4c23505 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736856662868-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1736856662868-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1736856662868 implements MigrationInterface { public name = "MigrationName1736856662868"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "IncidentFeed" ADD "postedAt" TIMESTAMP WITH TIME ZONE`, @@ -15,6 +16,7 @@ export class MigrationName1736856662868 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenanceFeed" DROP COLUMN "postedAt"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737141420441-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737141420441-MigrationName.ts index 0e92385ec9..7873e05176 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737141420441-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737141420441-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1737141420441 implements MigrationInterface { public name = "MigrationName1737141420441"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyExecutionLogTimeline" ADD "triggeredByAlertId" uuid`, @@ -66,6 +67,7 @@ export class MigrationName1737141420441 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "UserOnCallLogTimeline" DROP CONSTRAINT "FK_42d9916277fcbefa0cdd3904c63"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737713529424-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737713529424-MigrationName.ts index e5e2cc2f67..ef4881cd03 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737713529424-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737713529424-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1737713529424 implements MigrationInterface { public name = "MigrationName1737713529424"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" ADD "subscriberEmailNotificationFooterText" character varying(100)`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP COLUMN "subscriberEmailNotificationFooterText"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737715240684-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737715240684-MigrationName.ts index 94e5288fb8..8e13b45dbf 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737715240684-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737715240684-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1737715240684 implements MigrationInterface { public name = "MigrationName1737715240684"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP COLUMN "subscriberEmailNotificationFooterText"`, @@ -12,6 +13,7 @@ export class MigrationName1737715240684 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP COLUMN "subscriberEmailNotificationFooterText"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737997557974-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737997557974-MigrationName.ts index 5b86e1ab11..0c458b0bdb 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737997557974-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1737997557974-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1737997557974 implements MigrationInterface { public name = "MigrationName1737997557974"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE INDEX "IDX_4d5e62631b2b63aaecb00950ef" ON "MonitorTest" ("isInQueue") `, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_4d5e62631b2b63aaecb00950ef"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739209832500-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739209832500-MigrationName.ts index 0761271c42..c0bdded983 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739209832500-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739209832500-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1739209832500 implements MigrationInterface { public name = "MigrationName1739209832500"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "WorkspaceUserAuthToken" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "authToken" text NOT NULL, "workspaceUserId" character varying(500) NOT NULL, "workspaceType" character varying(500) NOT NULL, "miscData" jsonb NOT NULL, "userId" uuid, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_ae2f1b46b7e26f58a1f4a56b6ea" PRIMARY KEY ("_id"))`, @@ -78,6 +79,7 @@ export class MigrationName1739209832500 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "WorkspaceNotificationRule" DROP CONSTRAINT "FK_65ac673d16286be2dcd5229fe24"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739210586538-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739210586538-MigrationName.ts index c840d83e2e..bfbd3859d2 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739210586538-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739210586538-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1739210586538 implements MigrationInterface { public name = "MigrationName1739210586538"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "Alert" ADD "alertNumber" integer`); await queryRunner.query( @@ -10,6 +11,7 @@ export class MigrationName1739210586538 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_aa91b2228a2b35424a3ae93fdc"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739217257089-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739217257089-MigrationName.ts index a2464eb50d..de2055843e 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739217257089-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739217257089-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1739217257089 implements MigrationInterface { public name = "MigrationName1739217257089"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenance" ADD "scheduledMaintenanceNumber" integer`, @@ -12,6 +13,7 @@ export class MigrationName1739217257089 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_207fe82fd8bdc67bbe1aa0ebf8"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739282331053-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739282331053-MigrationName.ts index 968f6fffee..3763722348 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739282331053-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739282331053-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1739282331053 implements MigrationInterface { public name = "MigrationName1739282331053"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" ADD "postUpdatesToSlackChannelId" character varying(100)`, @@ -15,6 +16,7 @@ export class MigrationName1739282331053 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenance" DROP COLUMN "postUpdatesToSlackChannelId"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739374537088-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739374537088-MigrationName.ts index bb5e9da05d..9b8618c6f7 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739374537088-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739374537088-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1739374537088 implements MigrationInterface { public name = "MigrationName1739374537088"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" RENAME COLUMN "postUpdatesToSlackChannelId" TO "postUpdatesToWorkspaceChannelName"`, @@ -15,6 +16,7 @@ export class MigrationName1739374537088 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenance" RENAME COLUMN "postUpdatesToWorkspaceChannelName" TO "postUpdatesToSlackChannelId"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739569321582-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739569321582-MigrationName.ts index e31196b586..c9064bf687 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739569321582-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1739569321582-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1739569321582 implements MigrationInterface { public name = "MigrationName1739569321582"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" RENAME COLUMN "postUpdatesToWorkspaceChannelName" TO "postUpdatesToWorkspaceChannels"`, @@ -33,6 +34,7 @@ export class MigrationName1739569321582 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenance" DROP COLUMN "postUpdatesToWorkspaceChannels"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740164199817-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740164199817-MigrationName.ts index b71a28dedf..536a4bc8d6 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740164199817-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740164199817-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1740164199817 implements MigrationInterface { public name = "MigrationName1740164199817"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" ADD "isVisibleOnStatusPage" boolean DEFAULT true`, @@ -12,6 +13,7 @@ export class MigrationName1740164199817 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ScheduledMaintenance" DROP COLUMN "isVisibleOnStatusPage"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740419151825-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740419151825-MigrationName.ts index df44530e77..1851e9f50b 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740419151825-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740419151825-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1740419151825 implements MigrationInterface { public name = "MigrationName1740419151825"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" ADD "showIncidentsOnStatusPage" boolean NOT NULL DEFAULT true`, @@ -15,6 +16,7 @@ export class MigrationName1740419151825 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "StatusPage" DROP COLUMN "showScheduledMaintenanceEventsOnStatusPage"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740430229844-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740430229844-MigrationName.ts index a79d9e07da..cfe1efb997 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740430229844-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740430229844-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1740430229844 implements MigrationInterface { public name = "MigrationName1740430229844"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyExecutionLog" ADD "triggeredByUserId" uuid`, @@ -12,6 +13,7 @@ export class MigrationName1740430229844 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyExecutionLog" DROP CONSTRAINT "FK_0ed55adc637e8ed7a524f942b18"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740597525803-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740597525803-MigrationName.ts index 6fa0b4e5c3..046c6288d4 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740597525803-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740597525803-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1740597525803 implements MigrationInterface { public name = "MigrationName1740597525803"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" ADD "workspaceThreadIds" jsonb`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" DROP COLUMN "workspaceThreadIds"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740598793630-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740598793630-MigrationName.ts index 4c5d47d5f6..04df2811f6 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740598793630-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1740598793630-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1740598793630 implements MigrationInterface { public name = "MigrationName1740598793630"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" RENAME COLUMN "workspaceThreadIds" TO "workspaceSendMessageResponse"`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" RENAME COLUMN "workspaceSendMessageResponse" TO "workspaceThreadIds"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741031019972-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741031019972-MigrationName.ts index eb8ecd5e4f..f0cc1fa5c3 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741031019972-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741031019972-MigrationName.ts @@ -3,12 +3,14 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1741031019972 implements MigrationInterface { public name = "MigrationName1741031019972"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" DROP COLUMN "workspaceSendMessageResponse"`, ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "Incident" ADD "workspaceSendMessageResponse" jsonb`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741209339971-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741209339971-MigrationName.ts index 54bd575736..5dceb7eee7 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741209339971-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741209339971-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1741209339971 implements MigrationInterface { public name = "MigrationName1741209339971"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "ProjectUser" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "userId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_912199af7fc0be254b07b37306b" PRIMARY KEY ("_id"))`, @@ -54,6 +55,7 @@ export class MigrationName1741209339971 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ProjectUserInvitedTeams" DROP CONSTRAINT "FK_aa26c583621dab66eebfba67a44"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741904597606-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741904597606-MigrationName.ts index 78b84ef6e0..a04090adee 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741904597606-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741904597606-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1741904597606 implements MigrationInterface { public name = "MigrationName1741904597606"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "OnCallDutyPolicyUserOverride" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "onCallDutyPolicyId" uuid, "name" character varying(100) NOT NULL, "description" character varying(500), "createdByUserId" uuid, "overrideUserId" uuid NOT NULL, "routeAlertsToUserId" uuid NOT NULL, "startsAt" TIMESTAMP WITH TIME ZONE NOT NULL, "endsAt" TIMESTAMP WITH TIME ZONE NOT NULL, "deletedByUserId" uuid, CONSTRAINT "PK_41b216c8e71d15182fe67b75fec" PRIMARY KEY ("_id"))`, @@ -36,6 +37,7 @@ export class MigrationName1741904597606 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyUserOverride" DROP CONSTRAINT "FK_810a8cd7f838a8e141fd750a9d5"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741908200702-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741908200702-MigrationName.ts index ee087987d5..a971a43631 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741908200702-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741908200702-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1741908200702 implements MigrationInterface { public name = "MigrationName1741908200702"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `DROP INDEX "public"."IDX_b0bdac6c10d7ed30e696aded2c"`, @@ -15,6 +16,7 @@ export class MigrationName1741908200702 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyUserOverride" ADD "description" character varying(500)`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741955609393-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741955609393-MigrationName.ts index b745173d28..88efe1281d 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741955609393-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741955609393-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1741955609393 implements MigrationInterface { public name = "MigrationName1741955609393"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "GlobalConfig" RENAME COLUMN "twilioPhoneNumber" TO "twilioPrimaryPhoneNumber"`, @@ -18,6 +19,7 @@ export class MigrationName1741955609393 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ProjectCallSMSConfig" DROP COLUMN "twilioSecondaryPhoneNumbers"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741955752685-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741955752685-MigrationName.ts index 99c37afa91..4995f3fe1f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741955752685-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741955752685-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1741955752685 implements MigrationInterface { public name = "MigrationName1741955752685"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "GlobalConfig" DROP CONSTRAINT "UQ_c223b66a0ca2fa8095cb7a6c7cc"`, @@ -12,6 +13,7 @@ export class MigrationName1741955752685 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "ProjectCallSMSConfig" ADD CONSTRAINT "UQ_50235223d7fd7b0c27063bfb08e" UNIQUE ("twilioPrimaryPhoneNumber")`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741957080431-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741957080431-MigrationName.ts index fc1598538f..c15dbf9d73 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741957080431-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741957080431-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1741957080431 implements MigrationInterface { public name = "MigrationName1741957080431"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "UserOnCallLog" ADD "overridedByUserId" uuid`, @@ -12,6 +13,7 @@ export class MigrationName1741957080431 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "UserOnCallLog" DROP CONSTRAINT "FK_702b8c74c8f0d7fb220bc407776"`, diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741959216297-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741959216297-MigrationName.ts index e64166c1f3..1c47dd318d 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741959216297-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1741959216297-MigrationName.ts @@ -3,6 +3,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1741959216297 implements MigrationInterface { public name = "MigrationName1741959216297"; + @CaptureSpan() public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyExecutionLogTimeline" ADD "overridedByUserId" uuid`, @@ -12,6 +13,7 @@ export class MigrationName1741959216297 implements MigrationInterface { ); } + @CaptureSpan() public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "OnCallDutyPolicyExecutionLogTimeline" DROP CONSTRAINT "FK_356ab0badd7e70f4d25045dcbf3"`, diff --git a/Common/Server/Services/AccessTokenService.ts b/Common/Server/Services/AccessTokenService.ts index e921fbe563..9daf66c381 100644 --- a/Common/Server/Services/AccessTokenService.ts +++ b/Common/Server/Services/AccessTokenService.ts @@ -22,6 +22,7 @@ export class AccessTokenService extends BaseService { super(); } + @CaptureSpan() public async refreshUserAllPermissions(userId: ObjectID): Promise { await this.refreshUserGlobalAccessPermission(userId); @@ -60,6 +61,7 @@ export class AccessTokenService extends BaseService { } } + @CaptureSpan() public async refreshUserGlobalAccessPermission( userId: ObjectID, ): Promise { @@ -104,6 +106,7 @@ export class AccessTokenService extends BaseService { return permissionToStore; } + @CaptureSpan() public async getUserGlobalAccessPermission( userId: ObjectID, ): Promise { @@ -117,6 +120,7 @@ export class AccessTokenService extends BaseService { return json; } + @CaptureSpan() public async refreshUserTenantAccessPermission( userId: ObjectID, projectId: ObjectID, @@ -199,6 +203,7 @@ export class AccessTokenService extends BaseService { return permission; } + @CaptureSpan() public async getDatabaseCommonInteractionPropsByUserAndProject(data: { userId: ObjectID; projectId: ObjectID; @@ -219,6 +224,7 @@ export class AccessTokenService extends BaseService { }; } + @CaptureSpan() public async getUserTenantAccessPermission( userId: ObjectID, projectId: ObjectID, diff --git a/Common/Server/Services/AlertFeedService.ts b/Common/Server/Services/AlertFeedService.ts index 881bbd1a10..c2629a8212 100644 --- a/Common/Server/Services/AlertFeedService.ts +++ b/Common/Server/Services/AlertFeedService.ts @@ -28,6 +28,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async createAlertFeedItem(data: { alertId: ObjectID; feedInfoInMarkdown: string; diff --git a/Common/Server/Services/AlertInternalNoteService.ts b/Common/Server/Services/AlertInternalNoteService.ts index 9a62895bc1..22104f3091 100644 --- a/Common/Server/Services/AlertInternalNoteService.ts +++ b/Common/Server/Services/AlertInternalNoteService.ts @@ -14,6 +14,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async addNote(data: { userId: ObjectID; alertId: ObjectID; diff --git a/Common/Server/Services/AlertService.ts b/Common/Server/Services/AlertService.ts index 43ba5a5613..160e4186d7 100644 --- a/Common/Server/Services/AlertService.ts +++ b/Common/Server/Services/AlertService.ts @@ -60,6 +60,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async isAlertAcknowledged(data: { alertId: ObjectID; }): Promise { @@ -104,6 +105,7 @@ export class Service extends DatabaseService { return false; } + @CaptureSpan() public async getExistingAlertNumberForProject(data: { projectId: ObjectID; }): Promise { @@ -130,6 +132,7 @@ export class Service extends DatabaseService { return lastAlert.alertNumber || 0; } + @CaptureSpan() public async acknowledgeAlert( alertId: ObjectID, acknowledgedByUserId: ObjectID, @@ -434,6 +437,7 @@ ${createdItem.remediationNotes || "No remediation notes provided."} return createdItem; } + @CaptureSpan() public async getWorkspaceChannelForAlert(data: { alertId: ObjectID; workspaceType?: WorkspaceType | null; @@ -463,6 +467,7 @@ ${createdItem.remediationNotes || "No remediation notes provided."} ); } + @CaptureSpan() public async getAlertIdentifiedDate(alertId: ObjectID): Promise { const timeline: AlertStateTimeline | null = await AlertStateTimelineService.findOneBy({ @@ -487,6 +492,7 @@ ${createdItem.remediationNotes || "No remediation notes provided."} return timeline.startsAt; } + @CaptureSpan() public async findOwners(alertId: ObjectID): Promise> { if (!alertId) { throw new BadDataException("alertId is required"); @@ -560,6 +566,7 @@ ${createdItem.remediationNotes || "No remediation notes provided."} return users; } + @CaptureSpan() public async addOwners( projectId: ObjectID, alertId: ObjectID, @@ -601,6 +608,7 @@ ${createdItem.remediationNotes || "No remediation notes provided."} } } + @CaptureSpan() public async getAlertLinkInDashboard( projectId: ObjectID, alertId: ObjectID, @@ -790,6 +798,7 @@ ${alertSeverity.name} return onUpdate; } + @CaptureSpan() public async doesMonitorHasMoreActiveManualAlerts( monitorId: ObjectID, proojectId: ObjectID, @@ -850,6 +859,7 @@ ${alertSeverity.name} }; } + @CaptureSpan() public async changeAlertState(data: { projectId: ObjectID; alertId: ObjectID; @@ -917,6 +927,7 @@ ${alertSeverity.name} }); } + @CaptureSpan() public async refreshAlertMetrics(data: { alertId: ObjectID }): Promise { const alert: Model | null = await this.findOneById({ id: data.alertId, @@ -1177,6 +1188,7 @@ ${alertSeverity.name} }); } + @CaptureSpan() public async isAlertResolved(data: { alertId: ObjectID }): Promise { const alert: Model | null = await this.findOneBy({ query: { @@ -1219,6 +1231,7 @@ ${alertSeverity.name} return false; } + @CaptureSpan() public async getAlertNumber(data: { alertId: ObjectID; }): Promise { @@ -1239,6 +1252,7 @@ ${alertSeverity.name} return alert.alertNumber || null; } + @CaptureSpan() public async resolveAlert( alertId: ObjectID, resolvedByUserId: ObjectID, diff --git a/Common/Server/Services/AlertStateService.ts b/Common/Server/Services/AlertStateService.ts index 9e179403e9..6ecde00483 100644 --- a/Common/Server/Services/AlertStateService.ts +++ b/Common/Server/Services/AlertStateService.ts @@ -152,6 +152,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getAllAlertStates(data: { projectId: ObjectID; props: DatabaseCommonInteractionProps; @@ -178,6 +179,7 @@ export class Service extends DatabaseService { return alertStates; } + @CaptureSpan() public async getUnresolvedAlertStates( projectId: ObjectID, props: DatabaseCommonInteractionProps, @@ -200,6 +202,7 @@ export class Service extends DatabaseService { return unresolvedAlertStates; } + @CaptureSpan() public async getResolvedAlertState(data: { projectId: ObjectID; props: DatabaseCommonInteractionProps; @@ -224,6 +227,7 @@ export class Service extends DatabaseService { return resolvedAlertState; } + @CaptureSpan() public async getAcknowledgedAlertState(data: { projectId: ObjectID; props: DatabaseCommonInteractionProps; diff --git a/Common/Server/Services/AlertStateTimelineService.ts b/Common/Server/Services/AlertStateTimelineService.ts index a6ef409f47..2924210247 100644 --- a/Common/Server/Services/AlertStateTimelineService.ts +++ b/Common/Server/Services/AlertStateTimelineService.ts @@ -29,6 +29,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getResolvedStateIdForProject( projectId: ObjectID, ): Promise { diff --git a/Common/Server/Services/AnalyticsDatabaseService.ts b/Common/Server/Services/AnalyticsDatabaseService.ts index a99b2f0037..63ef12b62d 100644 --- a/Common/Server/Services/AnalyticsDatabaseService.ts +++ b/Common/Server/Services/AnalyticsDatabaseService.ts @@ -84,6 +84,7 @@ export default class AnalyticsDatabaseService< }); } + @CaptureSpan() public async doesColumnExistInDatabase(columnName: string): Promise { const statement: string = this.statementGenerator.toDoesColumnExistStatement(columnName); @@ -97,6 +98,7 @@ export default class AnalyticsDatabaseService< return strResult.trim().length > 0; } + @CaptureSpan() public async getColumnTypeInDatabase( column: AnalyticsTableColumn, ): Promise { @@ -134,6 +136,7 @@ export default class AnalyticsDatabaseService< ); } + @CaptureSpan() public async countBy(countBy: CountBy): Promise { try { const checkReadPermissionType: CheckReadPermissionType = @@ -179,6 +182,7 @@ export default class AnalyticsDatabaseService< } } + @CaptureSpan() public async addColumnInDatabase( column: AnalyticsTableColumn, ): Promise { @@ -187,16 +191,19 @@ export default class AnalyticsDatabaseService< await this.execute(statement); } + @CaptureSpan() public async dropColumnInDatabase(columnName: string): Promise { await this.execute( this.statementGenerator.toDropColumnStatement(columnName), ); } + @CaptureSpan() public async findBy(findBy: FindBy): Promise> { return await this._findBy(findBy); } + @CaptureSpan() public async aggregateBy( aggregateBy: AggregateBy, ): Promise { @@ -660,6 +667,7 @@ export default class AnalyticsDatabaseService< return statement; } + @CaptureSpan() public async findOneBy( findOneBy: FindOneBy, ): Promise { @@ -675,6 +683,7 @@ export default class AnalyticsDatabaseService< return null; } + @CaptureSpan() public async deleteBy(deleteBy: DeleteBy): Promise { return await this._deleteBy(deleteBy); } @@ -715,6 +724,7 @@ export default class AnalyticsDatabaseService< } } + @CaptureSpan() public async findOneById( findOneById: FindOneByID, ): Promise { @@ -731,6 +741,7 @@ export default class AnalyticsDatabaseService< }); } + @CaptureSpan() public async updateBy(updateBy: UpdateBy): Promise { await this._updateBy(updateBy); } @@ -793,6 +804,7 @@ export default class AnalyticsDatabaseService< this.databaseClient = this.database.getDataSource() as ClickhouseClient; } + @CaptureSpan() public async execute( statement: Statement | string, ): Promise> { @@ -810,6 +822,7 @@ export default class AnalyticsDatabaseService< } + @CaptureSpan() public async executeQuery( statement: Statement | string, ): Promise> { @@ -910,6 +923,7 @@ export default class AnalyticsDatabaseService< return await this.onBeforeCreate(createBy); } + @CaptureSpan() public async createMany( createBy: CreateManyBy, ): Promise> { @@ -1053,6 +1067,7 @@ export default class AnalyticsDatabaseService< } } + @CaptureSpan() public async create(createBy: CreateBy): Promise { const items: Array = await this.createMany({ props: createBy.props, @@ -1098,6 +1113,7 @@ export default class AnalyticsDatabaseService< return true; } + @CaptureSpan() public async onTrigger( id: ObjectID, projectId: ObjectID, diff --git a/Common/Server/Services/BillingInvoiceService.ts b/Common/Server/Services/BillingInvoiceService.ts index 450cad7b4e..5233a2d824 100644 --- a/Common/Server/Services/BillingInvoiceService.ts +++ b/Common/Server/Services/BillingInvoiceService.ts @@ -22,6 +22,7 @@ export class Service extends DatabaseService { this.setDoNotAllowDelete(true); } + @CaptureSpan() public async refreshSubscriptionStatus(data: { projectId: ObjectID; }): Promise { diff --git a/Common/Server/Services/BillingService.ts b/Common/Server/Services/BillingService.ts index c2f730bec0..3885dfa0f9 100644 --- a/Common/Server/Services/BillingService.ts +++ b/Common/Server/Services/BillingService.ts @@ -49,6 +49,7 @@ export class BillingService extends BaseService { }); // returns billing id of the customer. + @CaptureSpan() public async createCustomer(data: { name: string; id: ObjectID; @@ -68,6 +69,7 @@ export class BillingService extends BaseService { return customer.id; } + @CaptureSpan() public async updateCustomerName(id: string, newName: string): Promise { if (!this.isBillingEnabled()) { throw new BadDataException(Errors.BillingService.BILLING_NOT_ENABLED); @@ -76,6 +78,7 @@ export class BillingService extends BaseService { await this.stripe.customers.update(id, { name: newName }); } + @CaptureSpan() public async deleteCustomer(id: string): Promise { if (!this.isBillingEnabled()) { throw new BadDataException(Errors.BillingService.BILLING_NOT_ENABLED); @@ -92,6 +95,7 @@ export class BillingService extends BaseService { return SubscriptionStatusUtil.isSubscriptionActive(status); } + @CaptureSpan() public async subscribeToMeteredPlan(data: { projectId: ObjectID; customerId: string; @@ -149,6 +153,7 @@ export class BillingService extends BaseService { return BillingPrivateKey.startsWith("sk_test"); } + @CaptureSpan() public async generateCouponCode(data: { name: string; metadata?: Dictionary | undefined; @@ -168,6 +173,7 @@ export class BillingService extends BaseService { return coupon.id; } + @CaptureSpan() public async subscribeToPlan(data: { projectId: ObjectID; customerId: string; @@ -247,6 +253,7 @@ export class BillingService extends BaseService { }; } + @CaptureSpan() public async changeQuantity( subscriptionId: string, quantity: number, @@ -285,6 +292,7 @@ export class BillingService extends BaseService { }); } + @CaptureSpan() public async addOrUpdateMeteredPricingOnSubscription( subscriptionId: string, serverMeteredPlan: ServerMeteredPlan, @@ -351,6 +359,7 @@ export class BillingService extends BaseService { // complete. } + @CaptureSpan() public async isPromoCodeValid(promoCode: string): Promise { if (!this.isBillingEnabled()) { throw new BadDataException(Errors.BillingService.BILLING_NOT_ENABLED); @@ -371,6 +380,7 @@ export class BillingService extends BaseService { } } + @CaptureSpan() public async removeSubscriptionItem( subscriptionId: string, subscriptionItemId: string, @@ -406,6 +416,7 @@ export class BillingService extends BaseService { ); } + @CaptureSpan() public async getSubscriptionItems( subscriptionId: string, ): Promise> { @@ -423,6 +434,7 @@ export class BillingService extends BaseService { return subscription.items.data; } + @CaptureSpan() public async changePlan(data: { projectId: ObjectID; subscriptionId: string; @@ -518,6 +530,7 @@ export class BillingService extends BaseService { return value; } + @CaptureSpan() public async deletePaymentMethod( customerId: string, paymentMethodId: string, @@ -538,6 +551,7 @@ export class BillingService extends BaseService { await this.stripe.paymentMethods.detach(paymentMethodId); } + @CaptureSpan() public async hasPaymentMethods(customerId: string): Promise { if ((await this.getPaymentMethods(customerId)).length > 0) { return true; @@ -546,6 +560,7 @@ export class BillingService extends BaseService { return false; } + @CaptureSpan() public async setDefaultPaymentMethod( customerId: string, paymentMethodId: string, @@ -557,6 +572,7 @@ export class BillingService extends BaseService { }); } + @CaptureSpan() public async getPaymentMethods( customerId: string, ): Promise> { @@ -643,6 +659,7 @@ export class BillingService extends BaseService { return paymentMethods; } + @CaptureSpan() public async getSetupIntentSecret(customerId: string): Promise { const setupIntent: Stripe.Response = await this.stripe.setupIntents.create({ @@ -656,6 +673,7 @@ export class BillingService extends BaseService { return setupIntent.client_secret; } + @CaptureSpan() public async cancelSubscription(subscriptionId: string): Promise { if (!this.isBillingEnabled()) { throw new BadDataException(Errors.BillingService.BILLING_NOT_ENABLED); @@ -667,6 +685,7 @@ export class BillingService extends BaseService { } } + @CaptureSpan() public async getSubscriptionStatus( subscriptionId: string, ): Promise { @@ -675,6 +694,7 @@ export class BillingService extends BaseService { return subscription.status as SubscriptionStatus; } + @CaptureSpan() public async getSubscription( subscriptionId: string, ): Promise { @@ -688,6 +708,7 @@ export class BillingService extends BaseService { return subscription; } + @CaptureSpan() public async getInvoices(customerId: string): Promise> { const invoices: Stripe.ApiList = await this.stripe.invoices.list({ @@ -721,6 +742,7 @@ export class BillingService extends BaseService { return billingInvoices; } + @CaptureSpan() public async generateInvoiceAndChargeCustomer( customerId: string, itemText: string, @@ -754,6 +776,7 @@ export class BillingService extends BaseService { } } + @CaptureSpan() public async voidInvoice(invoiceId: string): Promise { const invoice: Stripe.Invoice = await this.stripe.invoices.voidInvoice(invoiceId); @@ -761,6 +784,7 @@ export class BillingService extends BaseService { return invoice; } + @CaptureSpan() public async payInvoice( customerId: string, invoiceId: string, diff --git a/Common/Server/Services/CallService.ts b/Common/Server/Services/CallService.ts index 19521078f9..7aa57babf4 100644 --- a/Common/Server/Services/CallService.ts +++ b/Common/Server/Services/CallService.ts @@ -17,6 +17,7 @@ export class CallService extends BaseService { super(); } + @CaptureSpan() public async makeCall( callRequest: CallRequest, options: { diff --git a/Common/Server/Services/DatabaseService.ts b/Common/Server/Services/DatabaseService.ts index 3a0ab33288..78f732e98a 100644 --- a/Common/Server/Services/DatabaseService.ts +++ b/Common/Server/Services/DatabaseService.ts @@ -526,6 +526,7 @@ class DatabaseService extends BaseService { return data; } + @CaptureSpan() public async onTriggerRealtime( modelId: ObjectID, projectId: ObjectID, @@ -577,6 +578,7 @@ class DatabaseService extends BaseService { } } + @CaptureSpan() public async onTriggerWorkflow( id: ObjectID, projectId: ObjectID, @@ -609,6 +611,7 @@ class DatabaseService extends BaseService { } } + @CaptureSpan() public async create(createBy: CreateBy): Promise { const onCreate: OnCreate = createBy.props.ignoreHooks ? { createBy, carryForward: [] } @@ -829,6 +832,7 @@ class DatabaseService extends BaseService { return Promise.resolve(createBy); } + @CaptureSpan() public async countBy({ query, skip, @@ -905,6 +909,7 @@ class DatabaseService extends BaseService { } } + @CaptureSpan() public async deleteOneById(deleteById: DeleteById): Promise { await ModelPermission.checkDeletePermissionByModel({ modelType: this.modelType, @@ -940,16 +945,19 @@ class DatabaseService extends BaseService { }); } + @CaptureSpan() public async deleteOneBy( deleteOneBy: DeleteOneBy, ): Promise { return await this._deleteBy({ ...deleteOneBy, limit: 1, skip: 0 }); } + @CaptureSpan() public async deleteBy(deleteBy: DeleteBy): Promise { return await this._deleteBy(deleteBy); } + @CaptureSpan() public async hardDeleteBy(deleteBy: DeleteBy): Promise { try { const onDelete: OnDelete = deleteBy.props.ignoreHooks @@ -1125,6 +1133,7 @@ class DatabaseService extends BaseService { } } + @CaptureSpan() public async findBy(findBy: FindBy): Promise> { return await this._findBy(findBy); } @@ -1293,6 +1302,7 @@ class DatabaseService extends BaseService { return items; } + @CaptureSpan() public async findOneBy( findOneBy: FindOneBy, ): Promise { @@ -1308,6 +1318,7 @@ class DatabaseService extends BaseService { return null; } + @CaptureSpan() public async findOneById( findOneById: FindOneByID, ): Promise { @@ -1468,16 +1479,19 @@ class DatabaseService extends BaseService { return true; } + @CaptureSpan() public async updateOneBy( updateOneBy: UpdateOneBy, ): Promise { return await this._updateBy({ ...updateOneBy, limit: 1, skip: 0 }); } + @CaptureSpan() public async updateBy(updateBy: UpdateBy): Promise { return await this._updateBy(updateBy); } + @CaptureSpan() public async updateOneById( updateById: UpdateByID, ): Promise { @@ -1519,6 +1533,7 @@ class DatabaseService extends BaseService { }); } + @CaptureSpan() public async updateOneByIdAndFetch( updateById: UpdateByIDAndFetch, ): Promise { @@ -1530,6 +1545,7 @@ class DatabaseService extends BaseService { }); } + @CaptureSpan() public async searchBy({ skip, limit, diff --git a/Common/Server/Services/IncidentFeedService.ts b/Common/Server/Services/IncidentFeedService.ts index a33a049396..4f2daa3065 100644 --- a/Common/Server/Services/IncidentFeedService.ts +++ b/Common/Server/Services/IncidentFeedService.ts @@ -28,6 +28,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async createIncidentFeedItem(data: { incidentId: ObjectID; feedInfoInMarkdown: string; diff --git a/Common/Server/Services/IncidentInternalNoteService.ts b/Common/Server/Services/IncidentInternalNoteService.ts index 40ab07f22d..b58c68df19 100644 --- a/Common/Server/Services/IncidentInternalNoteService.ts +++ b/Common/Server/Services/IncidentInternalNoteService.ts @@ -15,6 +15,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async addNote(data: { userId: ObjectID; incidentId: ObjectID; diff --git a/Common/Server/Services/IncidentPublicNoteService.ts b/Common/Server/Services/IncidentPublicNoteService.ts index e91c095b08..ff7d3a7c84 100644 --- a/Common/Server/Services/IncidentPublicNoteService.ts +++ b/Common/Server/Services/IncidentPublicNoteService.ts @@ -16,6 +16,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async addNote(data: { userId: ObjectID; incidentId: ObjectID; diff --git a/Common/Server/Services/IncidentService.ts b/Common/Server/Services/IncidentService.ts index 22b589b793..1fe6853feb 100644 --- a/Common/Server/Services/IncidentService.ts +++ b/Common/Server/Services/IncidentService.ts @@ -67,6 +67,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async isIncidentResolved(data: { incidentId: ObjectID; }): Promise { @@ -112,6 +113,7 @@ export class Service extends DatabaseService { return false; } + @CaptureSpan() public async isIncidentAcknowledged(data: { incidentId: ObjectID; }): Promise { @@ -157,6 +159,7 @@ export class Service extends DatabaseService { return false; } + @CaptureSpan() public async resolveIncident( incidentId: ObjectID, resolvedByUserId: ObjectID, @@ -215,6 +218,7 @@ export class Service extends DatabaseService { return incident; } + @CaptureSpan() public async acknowledgeIncident( incidentId: ObjectID, acknowledgedByUserId: ObjectID, @@ -273,6 +277,7 @@ export class Service extends DatabaseService { return incident; } + @CaptureSpan() public async getExistingIncidentNumberForProject(data: { projectId: ObjectID; }): Promise { @@ -649,6 +654,7 @@ ${createdItem.remediationNotes || "No remediation notes provided."} return createdItem; } + @CaptureSpan() public async getIncidentIdentifiedDate(incidentId: ObjectID): Promise { const timeline: IncidentStateTimeline | null = await IncidentStateTimelineService.findOneBy({ @@ -673,6 +679,7 @@ ${createdItem.remediationNotes || "No remediation notes provided."} return timeline.startsAt; } + @CaptureSpan() public async findOwners(incidentId: ObjectID): Promise> { if (!incidentId) { throw new BadDataException("incidentId is required"); @@ -746,6 +753,7 @@ ${createdItem.remediationNotes || "No remediation notes provided."} return users; } + @CaptureSpan() public async addOwners( projectId: ObjectID, incidentId: ObjectID, @@ -787,6 +795,7 @@ ${createdItem.remediationNotes || "No remediation notes provided."} } } + @CaptureSpan() public async getIncidentLinkInDashboard( projectId: ObjectID, incidentId: ObjectID, @@ -980,6 +989,7 @@ ${incidentSeverity.name} return onUpdate; } + @CaptureSpan() public async doesMonitorHasMoreActiveManualIncidents( monitorId: ObjectID, proojectId: ObjectID, @@ -1015,6 +1025,7 @@ ${incidentSeverity.name} return incidentCount.toNumber() > 0; } + @CaptureSpan() public async markMonitorsActiveForMonitoring( projectId: ObjectID, monitors: Array, @@ -1149,6 +1160,7 @@ ${incidentSeverity.name} return onDelete; } + @CaptureSpan() public async changeIncidentState(data: { projectId: ObjectID; incidentId: ObjectID; @@ -1224,6 +1236,7 @@ ${incidentSeverity.name} }); } + @CaptureSpan() public async refreshIncidentMetrics(data: { incidentId: ObjectID; }): Promise { @@ -1510,6 +1523,7 @@ ${incidentSeverity.name} }); } + @CaptureSpan() public async getWorkspaceChannelForIncident(data: { incidentId: ObjectID; workspaceType?: WorkspaceType | null; @@ -1539,6 +1553,7 @@ ${incidentSeverity.name} ); } + @CaptureSpan() public async getIncidentNumber(data: { incidentId: ObjectID; }): Promise { diff --git a/Common/Server/Services/IncidentStateService.ts b/Common/Server/Services/IncidentStateService.ts index 287eace53d..c4208ea329 100644 --- a/Common/Server/Services/IncidentStateService.ts +++ b/Common/Server/Services/IncidentStateService.ts @@ -152,6 +152,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getAllIncidentStates(data: { projectId: ObjectID; props: DatabaseCommonInteractionProps; @@ -179,6 +180,7 @@ export class Service extends DatabaseService { return incidentStates; } + @CaptureSpan() public async getUnresolvedIncidentStates( projectId: ObjectID, props: DatabaseCommonInteractionProps, @@ -202,6 +204,7 @@ export class Service extends DatabaseService { return unresolvedIncidentStates; } + @CaptureSpan() public async getResolvedIncidentState(data: { projectId: ObjectID; props: DatabaseCommonInteractionProps; @@ -226,6 +229,7 @@ export class Service extends DatabaseService { return resolvedIncidentState; } + @CaptureSpan() public async getAcknowledgedIncidentState(data: { projectId: ObjectID; props: DatabaseCommonInteractionProps; diff --git a/Common/Server/Services/IncidentStateTimelineService.ts b/Common/Server/Services/IncidentStateTimelineService.ts index 7010730cd2..4222274a6f 100644 --- a/Common/Server/Services/IncidentStateTimelineService.ts +++ b/Common/Server/Services/IncidentStateTimelineService.ts @@ -30,6 +30,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getResolvedStateIdForProject( projectId: ObjectID, ): Promise { diff --git a/Common/Server/Services/IncidentTemplateService.ts b/Common/Server/Services/IncidentTemplateService.ts index 40d6f2deaa..05f128aa66 100644 --- a/Common/Server/Services/IncidentTemplateService.ts +++ b/Common/Server/Services/IncidentTemplateService.ts @@ -42,6 +42,7 @@ export class Service extends DatabaseService { return createdItem; } + @CaptureSpan() public async addOwners( projectId: ObjectID, incidentTemplateId: ObjectID, diff --git a/Common/Server/Services/MailService.ts b/Common/Server/Services/MailService.ts index addff2f15a..9f59d2d6c8 100644 --- a/Common/Server/Services/MailService.ts +++ b/Common/Server/Services/MailService.ts @@ -13,6 +13,7 @@ import ObjectID from "../../Types/ObjectID"; import API from "Common/Utils/API"; export class MailService extends BaseService { + @CaptureSpan() public async sendMail( mail: Email, options?: { diff --git a/Common/Server/Services/MonitorGroupService.ts b/Common/Server/Services/MonitorGroupService.ts index 2c9c8ef6c1..8ad682d111 100644 --- a/Common/Server/Services/MonitorGroupService.ts +++ b/Common/Server/Services/MonitorGroupService.ts @@ -42,6 +42,7 @@ export class Service extends DatabaseService { return { deleteBy, carryForward: null }; } + @CaptureSpan() public async getStatusTimeline( monitorGroupId: ObjectID, startDate: Date, @@ -117,6 +118,7 @@ export class Service extends DatabaseService { return monitorStatusTimelines; } + @CaptureSpan() public async getCurrentStatus( monitorGroupId: ObjectID, props: DatabaseCommonInteractionProps, diff --git a/Common/Server/Services/MonitorService.ts b/Common/Server/Services/MonitorService.ts index 32a1fa2487..5c79db0070 100644 --- a/Common/Server/Services/MonitorService.ts +++ b/Common/Server/Services/MonitorService.ts @@ -313,6 +313,7 @@ export class Service extends DatabaseService { return createdItem; } + @CaptureSpan() public async getMonitorLinkInDashboard( projectId: ObjectID, monitorId: ObjectID, @@ -324,6 +325,7 @@ export class Service extends DatabaseService { ); } + @CaptureSpan() public async findOwners(monitorId: ObjectID): Promise> { if (!monitorId) { throw new BadDataException("monitorId is required"); @@ -397,6 +399,7 @@ export class Service extends DatabaseService { return users; } + @CaptureSpan() public async addOwners( projectId: ObjectID, monitorId: ObjectID, @@ -438,6 +441,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async addDefaultProbesToMonitor( projectId: ObjectID, monitorId: ObjectID, @@ -492,6 +496,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async refreshMonitorProbeStatus(monitorId: ObjectID): Promise { const monitor: Model | null = await this.findOneById({ id: monitorId, @@ -644,6 +649,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getLabelsForMonitors(data: { monitorIds: Array; }): Promise> { @@ -686,6 +692,7 @@ export class Service extends DatabaseService { return labels; } + @CaptureSpan() public async notifyOwnersWhenNoProbeIsEnabled(data: { monitorId: ObjectID; isNoProbesEnabled: boolean; @@ -788,6 +795,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async notifyOwnersProbesDisconnected(data: { monitorId: ObjectID; isProbeDisconnected: boolean; @@ -886,6 +894,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async refreshProbeStatus(probeId: ObjectID): Promise { // get all the monitors for this probe. @@ -920,6 +929,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async changeMonitorStatus( projectId: ObjectID, monitorIds: Array, diff --git a/Common/Server/Services/NotificationService.ts b/Common/Server/Services/NotificationService.ts index a29a9e31c6..dcfdfbb835 100644 --- a/Common/Server/Services/NotificationService.ts +++ b/Common/Server/Services/NotificationService.ts @@ -12,6 +12,7 @@ export class NotificationService extends BaseService { super(); } + @CaptureSpan() public async rechargeBalance( projectId: ObjectID, amountInUSD: number, @@ -129,6 +130,7 @@ export class NotificationService extends BaseService { } } + @CaptureSpan() public async rechargeIfBalanceIsLow( projectId: ObjectID, options?: { diff --git a/Common/Server/Services/OnCallDutyPolicyEscalationRuleService.ts b/Common/Server/Services/OnCallDutyPolicyEscalationRuleService.ts index 6bfa3c0930..a449884b18 100644 --- a/Common/Server/Services/OnCallDutyPolicyEscalationRuleService.ts +++ b/Common/Server/Services/OnCallDutyPolicyEscalationRuleService.ts @@ -35,6 +35,7 @@ import OnCallDutyPolicyUserOverride from "../../Models/DatabaseModels/OnCallDuty import OnCallDutyPolicyUserOverrideService from "./OnCallDutyPolicyUserOverrideService"; export class Service extends DatabaseService { + @CaptureSpan() public async getRouteAlertToUserId(data: { userId: ObjectID; onCallDutyPolicyId: ObjectID; @@ -101,6 +102,7 @@ export class Service extends DatabaseService { return null; } + @CaptureSpan() public async startRuleExecution( ruleId: ObjectID, options: { @@ -484,6 +486,7 @@ export class Service extends DatabaseService { return createdItem; } + @CaptureSpan() public async addUsersTeamsAndSchedules( projectId: ObjectID, escalationRuleId: ObjectID, @@ -524,6 +527,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async addTeam( projectId: ObjectID, escalationRuleId: ObjectID, @@ -544,6 +548,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async addOnCallSchedules( projectId: ObjectID, escalationRuleId: ObjectID, @@ -564,6 +569,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async addUser( projectId: ObjectID, escalationRuleId: ObjectID, diff --git a/Common/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts b/Common/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts index 0d5befd779..0196ccaae1 100644 --- a/Common/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +++ b/Common/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts @@ -63,6 +63,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async addToIncidentOrAlertFeed(data: { onCallDutyPolicyExecutionLogTimelineId: ObjectID; }): Promise { diff --git a/Common/Server/Services/OnCallDutyPolicyScheduleService.ts b/Common/Server/Services/OnCallDutyPolicyScheduleService.ts index 76681c4a14..b4176c8c40 100644 --- a/Common/Server/Services/OnCallDutyPolicyScheduleService.ts +++ b/Common/Server/Services/OnCallDutyPolicyScheduleService.ts @@ -17,6 +17,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async getCurrentUserIdInSchedule( scheduleId: ObjectID, ): Promise { diff --git a/Common/Server/Services/OnCallDutyPolicyService.ts b/Common/Server/Services/OnCallDutyPolicyService.ts index 67f180a21b..8f6b1c9435 100644 --- a/Common/Server/Services/OnCallDutyPolicyService.ts +++ b/Common/Server/Services/OnCallDutyPolicyService.ts @@ -14,6 +14,7 @@ export class Service extends DatabaseService { super(OnCallDutyPolicy); } + @CaptureSpan() public async getOnCallPolicyLinkInDashboard( projectId: ObjectID, onCallDutyPolicyId: ObjectID, @@ -25,6 +26,7 @@ export class Service extends DatabaseService { ); } + @CaptureSpan() public async executePolicy( policyId: ObjectID, options: { diff --git a/Common/Server/Services/OnCallDutyPolicyUserOverrideService.ts b/Common/Server/Services/OnCallDutyPolicyUserOverrideService.ts index ec13d47445..030308b06d 100644 --- a/Common/Server/Services/OnCallDutyPolicyUserOverrideService.ts +++ b/Common/Server/Services/OnCallDutyPolicyUserOverrideService.ts @@ -52,6 +52,7 @@ export class Service extends DatabaseService { }; } + @CaptureSpan() public async getOnCallDutyPolicyUserOverrideLinkInDashboard(data: { projectId: ObjectID; onCallDutyPolicyId?: ObjectID | undefined; // if this is null then this is a global override diff --git a/Common/Server/Services/ProbeService.ts b/Common/Server/Services/ProbeService.ts index 5c63ae0628..606219e9ea 100644 --- a/Common/Server/Services/ProbeService.ts +++ b/Common/Server/Services/ProbeService.ts @@ -48,6 +48,7 @@ export class Service extends DatabaseService { return { createBy: createBy, carryForward: [] }; } + @CaptureSpan() public async getOwners(probeId: ObjectID): Promise> { if (!probeId) { throw new BadDataException("probeId is required"); @@ -177,6 +178,7 @@ export class Service extends DatabaseService { return Promise.resolve(onUpdate); } + @CaptureSpan() public async notifyOwnersOnStatusChange(data: { probeId: ObjectID; }): Promise { @@ -282,6 +284,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getLinkInDashboard( projectId: ObjectID, probeId: ObjectID, diff --git a/Common/Server/Services/ProjectService.ts b/Common/Server/Services/ProjectService.ts index ddcb46e518..cf94192de1 100755 --- a/Common/Server/Services/ProjectService.ts +++ b/Common/Server/Services/ProjectService.ts @@ -732,6 +732,7 @@ export class ProjectService extends DatabaseService { return createdItem; } + @CaptureSpan() public async addDefaultAlertState(createdItem: Model): Promise { let createdAlertState: AlertState = new AlertState(); createdAlertState.name = "Identified"; @@ -784,6 +785,7 @@ export class ProjectService extends DatabaseService { return createdItem; } + @CaptureSpan() public async addDefaultAlertSeverity(createdItem: Model): Promise { let highSeverity: AlertSeverity = new AlertSeverity(); highSeverity.name = "High"; @@ -1057,6 +1059,7 @@ export class ProjectService extends DatabaseService { return createdItem; } + @CaptureSpan() public async updateLastActive(projectId: ObjectID): Promise { await this.updateOneById({ id: projectId, @@ -1069,6 +1072,7 @@ export class ProjectService extends DatabaseService { }); } + @CaptureSpan() public async getOwners(projectId: ObjectID): Promise> { if (!projectId) { throw new BadDataException("Project ID is required"); @@ -1208,6 +1212,7 @@ export class ProjectService extends DatabaseService { return onDelete; } + @CaptureSpan() public async getCurrentPlan(projectId: ObjectID): Promise { if (!IsBillingEnabled) { return { plan: null, isSubscriptionUnpaid: false }; @@ -1251,6 +1256,7 @@ export class ProjectService extends DatabaseService { }; } + @CaptureSpan() public async sendEmailToProjectOwners( projectId: ObjectID, subject: string, @@ -1286,6 +1292,7 @@ export class ProjectService extends DatabaseService { } } + @CaptureSpan() public async reactiveSubscription(projectId: ObjectID): Promise { logger.debug("Reactivating subscription for project " + projectId); @@ -1401,6 +1408,7 @@ export class ProjectService extends DatabaseService { }; } + @CaptureSpan() public async isSMSNotificationsEnabled( projectId: ObjectID, ): Promise { diff --git a/Common/Server/Services/ProjectUserService.ts b/Common/Server/Services/ProjectUserService.ts index 00af13ba7a..4dd25a6636 100644 --- a/Common/Server/Services/ProjectUserService.ts +++ b/Common/Server/Services/ProjectUserService.ts @@ -10,6 +10,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async refreshProjectUsersByProject(data: { projectId: ObjectID; }): Promise { diff --git a/Common/Server/Services/ScheduledMaintenanceFeedService.ts b/Common/Server/Services/ScheduledMaintenanceFeedService.ts index 9c3ed0114e..1f9e8296a1 100644 --- a/Common/Server/Services/ScheduledMaintenanceFeedService.ts +++ b/Common/Server/Services/ScheduledMaintenanceFeedService.ts @@ -28,6 +28,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async createScheduledMaintenanceFeedItem(data: { scheduledMaintenanceId: ObjectID; feedInfoInMarkdown: string; diff --git a/Common/Server/Services/ScheduledMaintenanceInternalNoteService.ts b/Common/Server/Services/ScheduledMaintenanceInternalNoteService.ts index f95db84435..eebd6a8683 100644 --- a/Common/Server/Services/ScheduledMaintenanceInternalNoteService.ts +++ b/Common/Server/Services/ScheduledMaintenanceInternalNoteService.ts @@ -14,6 +14,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async addNote(data: { userId: ObjectID; scheduledMaintenanceId: ObjectID; diff --git a/Common/Server/Services/ScheduledMaintenancePublicNoteService.ts b/Common/Server/Services/ScheduledMaintenancePublicNoteService.ts index 969dc1e645..3e6740b150 100644 --- a/Common/Server/Services/ScheduledMaintenancePublicNoteService.ts +++ b/Common/Server/Services/ScheduledMaintenancePublicNoteService.ts @@ -120,6 +120,7 @@ ${updatedItem.note} return onUpdate; } + @CaptureSpan() public async addNote(data: { userId: ObjectID; scheduledMaintenanceId: ObjectID; diff --git a/Common/Server/Services/ScheduledMaintenanceService.ts b/Common/Server/Services/ScheduledMaintenanceService.ts index 1501a3a0e8..9f4b288421 100644 --- a/Common/Server/Services/ScheduledMaintenanceService.ts +++ b/Common/Server/Services/ScheduledMaintenanceService.ts @@ -65,6 +65,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getExistingScheduledMaintenanceNumberForProject(data: { projectId: ObjectID; }): Promise { @@ -91,6 +92,7 @@ export class Service extends DatabaseService { return lastScheduledMaintenance.scheduledMaintenanceNumber || 0; } + @CaptureSpan() public async notififySubscribersOnEventScheduled( scheduledEvents: Array, ): Promise { @@ -645,6 +647,7 @@ ${createdItem.description || "No description provided."} return createdItem; } + @CaptureSpan() public async addOwners( projectId: ObjectID, scheduledMaintenanceId: ObjectID, @@ -688,6 +691,7 @@ ${createdItem.description || "No description provided."} } } + @CaptureSpan() public async getScheduledMaintenanceLinkInDashboard( projectId: ObjectID, scheduledMaintenanceId: ObjectID, @@ -699,6 +703,7 @@ ${createdItem.description || "No description provided."} ); } + @CaptureSpan() public async findOwners( scheduledMaintenanceId: ObjectID, ): Promise> { @@ -775,6 +780,7 @@ ${createdItem.description || "No description provided."} return users; } + @CaptureSpan() public async changeAttachedMonitorStates( item: Model, props: DatabaseCommonInteractionProps, @@ -1053,6 +1059,7 @@ ${labels return onUpdate; } + @CaptureSpan() public async changeScheduledMaintenanceState(data: { projectId: ObjectID; scheduledMaintenanceId: ObjectID; @@ -1143,6 +1150,7 @@ ${labels }); } + @CaptureSpan() public async isScheduledMaintenanceCompleted(data: { scheduledMaintenanceId: ObjectID; }): Promise { @@ -1194,6 +1202,7 @@ ${labels return false; } + @CaptureSpan() public async getScheduledMaintenanceNumber(data: { scheduledMaintenanceId: ObjectID; }): Promise { @@ -1214,6 +1223,7 @@ ${labels return scheduledMaintenance.scheduledMaintenanceNumber || null; } + @CaptureSpan() public async isScheduledMaintenanceOngoing(data: { scheduledMaintenanceId: ObjectID; }): Promise { @@ -1264,6 +1274,7 @@ ${labels return false; } + @CaptureSpan() public async markScheduledMaintenanceAsComplete( scheduledMaintenanceId: ObjectID, resolvedByUserId: ObjectID, @@ -1325,6 +1336,7 @@ ${labels return scheduledMaintenance; } + @CaptureSpan() public async markScheduledMaintenanceAsOngoing( scheduledMaintenanceId: ObjectID, markedByUserId: ObjectID, @@ -1386,6 +1398,7 @@ ${labels return scheduledMaintenance; } + @CaptureSpan() public async getWorkspaceChannelForScheduledMaintenance(data: { scheduledMaintenanceId: ObjectID; workspaceType?: WorkspaceType | null; diff --git a/Common/Server/Services/ScheduledMaintenanceStateService.ts b/Common/Server/Services/ScheduledMaintenanceStateService.ts index 63165c39c1..21a1086c3d 100644 --- a/Common/Server/Services/ScheduledMaintenanceStateService.ts +++ b/Common/Server/Services/ScheduledMaintenanceStateService.ts @@ -162,6 +162,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getCompletedScheduledMaintenanceState(data: { projectId: ObjectID; props: DatabaseCommonInteractionProps; @@ -189,6 +190,7 @@ export class Service extends DatabaseService { return resolvedScheduledMaintenanceState; } + @CaptureSpan() public async getAllScheduledMaintenanceStates(data: { projectId: ObjectID; props: DatabaseCommonInteractionProps; @@ -217,6 +219,7 @@ export class Service extends DatabaseService { return scheduledMaintenanceStates; } + @CaptureSpan() public async getOngoingScheduledMaintenanceState(data: { projectId: ObjectID; props: DatabaseCommonInteractionProps; diff --git a/Common/Server/Services/ScheduledMaintenanceStateTimelineService.ts b/Common/Server/Services/ScheduledMaintenanceStateTimelineService.ts index 72d64d0d9c..9be272b8de 100644 --- a/Common/Server/Services/ScheduledMaintenanceStateTimelineService.ts +++ b/Common/Server/Services/ScheduledMaintenanceStateTimelineService.ts @@ -361,6 +361,7 @@ export class Service extends DatabaseService return createdItem; } + @CaptureSpan() public async enableActiveMonitoringForMonitors( scheduledMaintenanceEvent: ScheduledMaintenance, ): Promise { @@ -446,6 +447,7 @@ export class Service extends DatabaseService } } + @CaptureSpan() public async hasThisMonitorMoreOngoingScheduledMaintenanceEvents( id: ObjectID, ): Promise { diff --git a/Common/Server/Services/ScheduledMaintenanceTemplateService.ts b/Common/Server/Services/ScheduledMaintenanceTemplateService.ts index c7159c696d..92635d7140 100644 --- a/Common/Server/Services/ScheduledMaintenanceTemplateService.ts +++ b/Common/Server/Services/ScheduledMaintenanceTemplateService.ts @@ -275,6 +275,7 @@ export class Service extends DatabaseService { return createdItem; } + @CaptureSpan() public async addOwners( projectId: ObjectID, scheduledMaintenanceTemplateId: ObjectID, diff --git a/Common/Server/Services/ShortLinkService.ts b/Common/Server/Services/ShortLinkService.ts index a250324238..49a612d234 100644 --- a/Common/Server/Services/ShortLinkService.ts +++ b/Common/Server/Services/ShortLinkService.ts @@ -27,12 +27,14 @@ export class Service extends DatabaseService { return { createBy: createBy, carryForward: [] }; } + @CaptureSpan() public async saveShortLinkFor(url: URL): Promise { const model: Model = new Model(); model.link = url; return await this.create({ data: model, props: { isRoot: true } }); } + @CaptureSpan() public async getShortenedUrl(model: Model): Promise { const host: Hostname = await DatabaseConfig.getHost(); const httpProtocol: Protocol = await DatabaseConfig.getHttpProtocol(); @@ -45,6 +47,7 @@ export class Service extends DatabaseService { ); } + @CaptureSpan() public async getShortLinkFor(shortLinkId: string): Promise { return await this.findOneBy({ query: { diff --git a/Common/Server/Services/SmsService.ts b/Common/Server/Services/SmsService.ts index 060a569cf3..8cfdebc25c 100644 --- a/Common/Server/Services/SmsService.ts +++ b/Common/Server/Services/SmsService.ts @@ -17,6 +17,7 @@ export class SmsService extends BaseService { super(); } + @CaptureSpan() public async sendSms( sms: SMS, options: { diff --git a/Common/Server/Services/StatusPageCertificateService.ts b/Common/Server/Services/StatusPageCertificateService.ts index c1e9facb93..cafdc3d82a 100644 --- a/Common/Server/Services/StatusPageCertificateService.ts +++ b/Common/Server/Services/StatusPageCertificateService.ts @@ -14,6 +14,7 @@ export class StatusPageCertificateService extends BaseService { super(); } + @CaptureSpan() public async add(domain: string): Promise> { const body: JSONObject = { domain: domain, @@ -27,6 +28,7 @@ export class StatusPageCertificateService extends BaseService { ); } + @CaptureSpan() public async remove( domain: string, ): Promise> { @@ -42,6 +44,7 @@ export class StatusPageCertificateService extends BaseService { ); } + @CaptureSpan() public async get(domain: string): Promise> { const body: JSONObject = { domain: domain, diff --git a/Common/Server/Services/StatusPageDomainService.ts b/Common/Server/Services/StatusPageDomainService.ts index a8272c90ae..467600f5d2 100644 --- a/Common/Server/Services/StatusPageDomainService.ts +++ b/Common/Server/Services/StatusPageDomainService.ts @@ -93,10 +93,12 @@ export class Service extends DatabaseService { return onDelete; } + @CaptureSpan() public async removeDomainFromGreenlock(domain: string): Promise { await GreenlockUtil.removeDomain(domain); } + @CaptureSpan() public async orderCert(statusPageDomain: StatusPageDomain): Promise { return Telemetry.startActiveSpan>({ name: "StatusPageDomainService.orderCert", @@ -175,6 +177,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async updateSslProvisioningStatusForAllDomains(): Promise { const domains: Array = await this.findBy({ query: { @@ -221,6 +224,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async updateCnameStatusForStatusPageDomain(data: { domain: string; cnameStatus: boolean; @@ -254,6 +258,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async isCnameValid(fullDomain: string): Promise { try { // get the token from the domain. @@ -346,6 +351,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async updateSslProvisioningStatus( domain: StatusPageDomain, ): Promise { @@ -422,6 +428,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async orderSSLForDomainsWhichAreNotOrderedYet(): Promise { return Telemetry.startActiveSpan>({ name: "StatusPageDomainService.orderSSLForDomainsWhichAreNotOrderedYet", @@ -466,6 +473,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async verifyCnameWhoseCnameisNotVerified(): Promise { const domains: Array = await this.findBy({ query: { @@ -491,6 +499,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async renewCertsWhichAreExpiringSoon(): Promise { await GreenlockUtil.renewAllCertsWhichAreExpiringSoon({ validateCname: async (fullDomain: string) => { @@ -516,6 +525,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async checkOrderStatus(): Promise { const domains: Array = await this.findBy({ query: { diff --git a/Common/Server/Services/StatusPageService.ts b/Common/Server/Services/StatusPageService.ts index 22d1b866db..7d62bd7cac 100755 --- a/Common/Server/Services/StatusPageService.ts +++ b/Common/Server/Services/StatusPageService.ts @@ -188,6 +188,7 @@ export class Service extends DatabaseService { return createdItem; } + @CaptureSpan() public async findOwners(statusPageId: ObjectID): Promise> { if (!statusPageId) { throw new BadDataException("statusPageId is required"); @@ -260,6 +261,7 @@ export class Service extends DatabaseService { return users; } + @CaptureSpan() public async addOwners( projectId: ObjectID, statusPageId: ObjectID, @@ -301,6 +303,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getStatusPageLinkInDashboard( projectId: ObjectID, statusPageId: ObjectID, @@ -312,6 +315,7 @@ export class Service extends DatabaseService { ); } + @CaptureSpan() public async hasReadAccess( statusPageId: ObjectID, props: DatabaseCommonInteractionProps, @@ -378,6 +382,7 @@ export class Service extends DatabaseService { return false; } + @CaptureSpan() public async getMonitorStatusTimelineForStatusPage(data: { monitorIds: Array; startDate: Date; @@ -458,6 +463,7 @@ export class Service extends DatabaseService { return monitorStatusTimelines; } + @CaptureSpan() public async getStatusPageURL(statusPageId: ObjectID): Promise { const domain: StatusPageDomain | null = await StatusPageDomainService.findOneBy({ @@ -492,6 +498,7 @@ export class Service extends DatabaseService { return statusPageURL; } + @CaptureSpan() public async getStatusPageFirstURL(statusPageId: ObjectID): Promise { const domains: Array = await StatusPageDomainService.findBy({ @@ -604,6 +611,7 @@ export class Service extends DatabaseService { }; } + @CaptureSpan() public async sendEmailReport(data: { statusPageId: ObjectID; email?: Email | undefined; @@ -730,6 +738,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getReportByStatusPage(data: { statusPageId: ObjectID; historyDays: number; @@ -872,6 +881,7 @@ export class Service extends DatabaseService { }; } + @CaptureSpan() public async getIncidentCountByMonitorIds(data: { monitorIds: Array; historyDays: number; @@ -895,6 +905,7 @@ export class Service extends DatabaseService { return incidentCount.toNumber(); } + @CaptureSpan() public async getIncidentCountOnStatusPage(data: { statusPageId: ObjectID; historyDays: number; @@ -912,6 +923,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async getMonitorIdsOnStatusPage(data: { statusPageId: ObjectID; }): Promise<{ @@ -987,6 +999,7 @@ export class Service extends DatabaseService { }; } + @CaptureSpan() public async getStatusPageResources(data: { statusPageId: ObjectID; }): Promise> { diff --git a/Common/Server/Services/StatusPageSubscriberService.ts b/Common/Server/Services/StatusPageSubscriberService.ts index 7c6eef2ec7..7d43994fca 100644 --- a/Common/Server/Services/StatusPageSubscriberService.ts +++ b/Common/Server/Services/StatusPageSubscriberService.ts @@ -332,6 +332,7 @@ export class Service extends DatabaseService { return createdItem; } + @CaptureSpan() public async sendConfirmSubscriptionEmail(data: { subscriberId: ObjectID; }): Promise { @@ -465,6 +466,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async sendYouHaveSubscribedEmail(data: { subscriberId: ObjectID; }): Promise { @@ -611,6 +613,7 @@ export class Service extends DatabaseService { return confirmSubscriptionLink; } + @CaptureSpan() public async getSubscribersByStatusPage( statusPageId: ObjectID, props: DatabaseCommonInteractionProps, @@ -756,6 +759,7 @@ export class Service extends DatabaseService { return shouldSendNotification; } + @CaptureSpan() public async getStatusPagesToSendNotification( statusPageIds: Array, ): Promise> { diff --git a/Common/Server/Services/TeamMemberService.ts b/Common/Server/Services/TeamMemberService.ts index df7001bd70..600fd24c7f 100644 --- a/Common/Server/Services/TeamMemberService.ts +++ b/Common/Server/Services/TeamMemberService.ts @@ -165,6 +165,7 @@ export class TeamMemberService extends DatabaseService { return { createBy, carryForward: null }; } + @CaptureSpan() public async refreshTokens( userId: ObjectID, projectId: ObjectID, @@ -329,6 +330,7 @@ export class TeamMemberService extends DatabaseService { return onDelete; } + @CaptureSpan() public async getUniqueTeamMemberCountInProject( projectId: ObjectID, ): Promise { @@ -357,6 +359,7 @@ export class TeamMemberService extends DatabaseService { return [...new Set(memberIds)].length; //get unique member ids. } + @CaptureSpan() public async getUsersInTeams(teamIds: Array): Promise> { const members: Array = await this.findBy({ query: { @@ -394,6 +397,7 @@ export class TeamMemberService extends DatabaseService { }); } + @CaptureSpan() public async getUsersInTeam(teamId: ObjectID): Promise> { const members: Array = await this.findBy({ query: { @@ -420,6 +424,7 @@ export class TeamMemberService extends DatabaseService { }); } + @CaptureSpan() public async updateSubscriptionSeatsByUniqueTeamMembersInProject( projectId: ObjectID, ): Promise { diff --git a/Common/Server/Services/TelemetryAttributeService.ts b/Common/Server/Services/TelemetryAttributeService.ts index 9826eb42e1..4ef72628c0 100644 --- a/Common/Server/Services/TelemetryAttributeService.ts +++ b/Common/Server/Services/TelemetryAttributeService.ts @@ -10,6 +10,7 @@ export class TelemetryAttributeService extends AnalyticsDatabaseService { }; } + @CaptureSpan() public async getTelemetryDataRetentionInDays( telemetryServiceId: ObjectID, ): Promise { diff --git a/Common/Server/Services/TelemetryUsageBillingService.ts b/Common/Server/Services/TelemetryUsageBillingService.ts index 68737dd4b1..20c7a2f6b5 100644 --- a/Common/Server/Services/TelemetryUsageBillingService.ts +++ b/Common/Server/Services/TelemetryUsageBillingService.ts @@ -20,6 +20,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async getUnreportedUsageBilling(data: { projectId: ObjectID; productType: ProductType; @@ -45,6 +46,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async updateUsageBilling(data: { projectId: ObjectID; productType: ProductType; diff --git a/Common/Server/Services/UserCallService.ts b/Common/Server/Services/UserCallService.ts index 25d391536e..cc2f13fc26 100644 --- a/Common/Server/Services/UserCallService.ts +++ b/Common/Server/Services/UserCallService.ts @@ -108,6 +108,7 @@ export class Service extends DatabaseService { return createdItem; } + @CaptureSpan() public async resendVerificationCode(itemId: ObjectID): Promise { const item: Model | null = await this.findOneById({ id: itemId, diff --git a/Common/Server/Services/UserEmailService.ts b/Common/Server/Services/UserEmailService.ts index 32aa2d56b3..0f4ad0baa8 100644 --- a/Common/Server/Services/UserEmailService.ts +++ b/Common/Server/Services/UserEmailService.ts @@ -78,6 +78,7 @@ export class Service extends DatabaseService { return createdItem; } + @CaptureSpan() public async resendVerificationCode(itemId: ObjectID): Promise { const item: Model | null = await this.findOneById({ id: itemId, diff --git a/Common/Server/Services/UserNotificationRuleService.ts b/Common/Server/Services/UserNotificationRuleService.ts index 4a21309033..1da6ba0125 100644 --- a/Common/Server/Services/UserNotificationRuleService.ts +++ b/Common/Server/Services/UserNotificationRuleService.ts @@ -54,6 +54,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async executeNotificationRuleItem( userNotificationRuleId: ObjectID, options: { @@ -585,6 +586,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async generateCallTemplateForAlertCreated( to: Phone, alert: Alert, @@ -635,6 +637,7 @@ export class Service extends DatabaseService { return callRequest; } + @CaptureSpan() public async generateCallTemplateForIncidentCreated( to: Phone, incident: Incident, @@ -685,6 +688,7 @@ export class Service extends DatabaseService { return callRequest; } + @CaptureSpan() public async generateSmsTemplateForAlertCreated( to: Phone, alert: Alert, @@ -714,6 +718,7 @@ export class Service extends DatabaseService { return sms; } + @CaptureSpan() public async generateSmsTemplateForIncidentCreated( to: Phone, incident: Incident, @@ -743,6 +748,7 @@ export class Service extends DatabaseService { return sms; } + @CaptureSpan() public async generateEmailTemplateForAlertCreated( to: Email, alert: Alert, @@ -782,6 +788,7 @@ export class Service extends DatabaseService { return emailMessage; } + @CaptureSpan() public async generateEmailTemplateForIncidentCreated( to: Email, incident: Incident, @@ -826,6 +833,7 @@ export class Service extends DatabaseService { return emailMessage; } + @CaptureSpan() public async startUserNotificationRulesExecution( userId: ObjectID, options: { @@ -911,6 +919,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async runWorkspaceRulesForOnCallNotification(data: { projectId: ObjectID; incidentId?: ObjectID | undefined; @@ -989,6 +998,7 @@ export class Service extends DatabaseService { }; } + @CaptureSpan() public async addDefaultIncidentNotificationRuleForUser(data: { projectId: ObjectID; userId: ObjectID; @@ -1049,6 +1059,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async addDefaultAlertNotificationRulesForUser(data: { projectId: ObjectID; userId: ObjectID; @@ -1109,6 +1120,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async addDefaultNotificationRuleForUser( projectId: ObjectID, userId: ObjectID, diff --git a/Common/Server/Services/UserNotificationSettingService.ts b/Common/Server/Services/UserNotificationSettingService.ts index 7a403dfbf3..61f37078da 100644 --- a/Common/Server/Services/UserNotificationSettingService.ts +++ b/Common/Server/Services/UserNotificationSettingService.ts @@ -27,6 +27,7 @@ export class Service extends DatabaseService { super(UserNotificationSetting); } + @CaptureSpan() public async sendUserNotification(data: { userId: ObjectID; projectId: ObjectID; @@ -158,6 +159,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async removeDefaultNotificationSettingsForUser( userId: ObjectID, projectId: ObjectID, @@ -189,6 +191,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async addDefaultNotificationSettingsForUser( userId: ObjectID, projectId: ObjectID, diff --git a/Common/Server/Services/UserService.ts b/Common/Server/Services/UserService.ts index 449a75fc15..c2c3ba8bc8 100755 --- a/Common/Server/Services/UserService.ts +++ b/Common/Server/Services/UserService.ts @@ -39,6 +39,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async getUserMarkdownString(data: { userId: ObjectID; projectId: ObjectID; @@ -63,6 +64,7 @@ export class Service extends DatabaseService { return `[${user.name?.toString() || user.email?.toString() || "User"}](${(await this.getUserLinkInDashboard(data.projectId, data.userId)).toString()})`; } + @CaptureSpan() public async getUserLinkInDashboard( projectId: ObjectID, userId: ObjectID, @@ -96,6 +98,7 @@ export class Service extends DatabaseService { return Promise.resolve(createdItem); } + @CaptureSpan() public async findByEmail( email: Email, props: DatabaseCommonInteractionProps, @@ -326,6 +329,7 @@ export class Service extends DatabaseService { return onUpdate; } + @CaptureSpan() public async createByEmail(data: { email: Email; name: Name | undefined; diff --git a/Common/Server/Services/UserSmsService.ts b/Common/Server/Services/UserSmsService.ts index 35711cb98a..06a4bb90f6 100644 --- a/Common/Server/Services/UserSmsService.ts +++ b/Common/Server/Services/UserSmsService.ts @@ -108,6 +108,7 @@ export class Service extends DatabaseService { return createdItem; } + @CaptureSpan() public async resendVerificationCode(itemId: ObjectID): Promise { const item: Model | null = await this.findOneById({ id: itemId, diff --git a/Common/Server/Services/WorkspaceNotificationRuleService.ts b/Common/Server/Services/WorkspaceNotificationRuleService.ts index 607a4850d0..c2cb93a487 100644 --- a/Common/Server/Services/WorkspaceNotificationRuleService.ts +++ b/Common/Server/Services/WorkspaceNotificationRuleService.ts @@ -86,6 +86,7 @@ export class Service extends DatabaseService { throw new BadDataException("Workspace type not supported"); } + @CaptureSpan() public async getExistingChannelNamesBasedOnEventType(data: { projectId: ObjectID; workspaceType: WorkspaceType; @@ -119,6 +120,7 @@ export class Service extends DatabaseService { return existingChannelNames; } + @CaptureSpan() public async createChannelsAndInviteUsersToChannelsBasedOnRules(data: { projectId: ObjectID; notificationRuleEventType: NotificationRuleEventType; @@ -233,6 +235,7 @@ export class Service extends DatabaseService { }; } + @CaptureSpan() public async getNotificationRulesWhereOnCallIsTrue(data: { projectId: ObjectID; notificationFor: NotificationFor; @@ -264,6 +267,7 @@ export class Service extends DatabaseService { return result; } + @CaptureSpan() public async getNotificationRulesWhereInviteOwnersIsTrue(data: { projectId: ObjectID; notificationFor: NotificationFor; @@ -295,6 +299,7 @@ export class Service extends DatabaseService { return result; } + @CaptureSpan() public async inviteUsersAndTeamsToChannelsBasedOnRules(data: { projectId: ObjectID; projectAuth: WorkspaceProjectAuthToken; @@ -403,6 +408,7 @@ export class Service extends DatabaseService { logger.debug("Users invited to channels successfully"); } + @CaptureSpan() public async inviteUsersBasedOnRulesAndWorkspaceChannels(data: { workspaceChannels: Array; projectId: ObjectID; @@ -556,6 +562,7 @@ export class Service extends DatabaseService { } } + @CaptureSpan() public async inviteTeamsBasedOnRulesAndWorkspaceChannels(data: { workspaceChannels: Array; projectId: ObjectID; @@ -585,6 +592,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async getWorkspaceUserIdFromOneUptimeUserId(data: { projectId: ObjectID; workspaceType: WorkspaceType; @@ -619,6 +627,7 @@ export class Service extends DatabaseService { return userAuth.workspaceUserId?.toString() || null; } + @CaptureSpan() public async createChannelsBasedOnRules(data: { projectOrUserAuthTokenForWorkspace: string; workspaceType: WorkspaceType; @@ -691,6 +700,7 @@ export class Service extends DatabaseService { return createdWorkspaceChannels; } + @CaptureSpan() public async getUsersIdsToInviteToChannel(data: { notificationRules: Array; }): Promise< @@ -1225,6 +1235,7 @@ export class Service extends DatabaseService { throw new BadDataException("NotificationFor is not supported"); } + @CaptureSpan() public async getMatchingNotificationRules(data: { projectId: ObjectID; workspaceType: WorkspaceType; diff --git a/Common/Server/Services/WorkspaceProjectAuthTokenService.ts b/Common/Server/Services/WorkspaceProjectAuthTokenService.ts index e87f32ee77..8fb7037eb0 100644 --- a/Common/Server/Services/WorkspaceProjectAuthTokenService.ts +++ b/Common/Server/Services/WorkspaceProjectAuthTokenService.ts @@ -11,6 +11,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async getProjectAuth(data: { projectId: ObjectID; workspaceType: WorkspaceType; @@ -32,6 +33,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async getProjectAuths(data: { projectId: ObjectID; }): Promise> { @@ -53,6 +55,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async doesExist(data: { projectId: ObjectID; workspaceType: WorkspaceType; @@ -60,6 +63,7 @@ export class Service extends DatabaseService { return Boolean(await this.getProjectAuth(data)); } + @CaptureSpan() public async refreshAuthToken(data: { projectId: ObjectID; workspaceType: WorkspaceType; diff --git a/Common/Server/Services/WorkspaceSettingService.ts b/Common/Server/Services/WorkspaceSettingService.ts index 459e1abfe4..16149d7c81 100644 --- a/Common/Server/Services/WorkspaceSettingService.ts +++ b/Common/Server/Services/WorkspaceSettingService.ts @@ -10,6 +10,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async doesExist(data: { projectId: ObjectID; workspaceType: WorkspaceType; @@ -31,6 +32,7 @@ export class Service extends DatabaseService { ); } + @CaptureSpan() public async refreshSetting(data: { projectId: ObjectID; workspaceType: WorkspaceType; diff --git a/Common/Server/Services/WorkspaceUserAuthTokenService.ts b/Common/Server/Services/WorkspaceUserAuthTokenService.ts index 68d8b5fef7..1495ac7058 100644 --- a/Common/Server/Services/WorkspaceUserAuthTokenService.ts +++ b/Common/Server/Services/WorkspaceUserAuthTokenService.ts @@ -10,6 +10,7 @@ export class Service extends DatabaseService { super(Model); } + @CaptureSpan() public async getUserAuth(data: { projectId: ObjectID; userId: ObjectID; @@ -33,6 +34,7 @@ export class Service extends DatabaseService { }); } + @CaptureSpan() public async doesExist(data: { projectId: ObjectID; userId: ObjectID; @@ -56,6 +58,7 @@ export class Service extends DatabaseService { ); } + @CaptureSpan() public async refreshAuthToken(data: { projectId: ObjectID; userId: ObjectID; diff --git a/Common/Server/Types/AnalyticsDatabase/AggregateBy.ts b/Common/Server/Types/AnalyticsDatabase/AggregateBy.ts index 0bd0f6cd57..418d7fe21a 100644 --- a/Common/Server/Types/AnalyticsDatabase/AggregateBy.ts +++ b/Common/Server/Types/AnalyticsDatabase/AggregateBy.ts @@ -3,6 +3,7 @@ import CommonAggregateBy from "Common/Types/BaseDatabase/AggregateBy"; import AnalyticsBaseModel from "Common/Models/AnalyticsModels/AnalyticsBaseModel/AnalyticsBaseModel"; import DatabaseCommonInteractionProps from "Common/Types/BaseDatabase/DatabaseCommonInteractionProps"; import OneUptimeDate from "../../../Types/Date"; +import CaptureSpan from "../../Utils/Telemetry/CaptureSpan"; export default interface AggregateBy extends CommonAggregateBy { diff --git a/Common/Server/Types/AnalyticsDatabase/ModelPermission.ts b/Common/Server/Types/AnalyticsDatabase/ModelPermission.ts index 21f04bd3b4..f775db272f 100644 --- a/Common/Server/Types/AnalyticsDatabase/ModelPermission.ts +++ b/Common/Server/Types/AnalyticsDatabase/ModelPermission.ts @@ -26,6 +26,7 @@ import Permission, { UserPermission, } from "Common/Types/Permission"; import UserType from "Common/Types/UserType"; +import CaptureSpan from "../../Utils/Telemetry/CaptureSpan"; export interface CheckReadPermissionType { query: Query; diff --git a/Common/Server/Types/Billing/MeteredPlan/ServerMeteredPlan.ts b/Common/Server/Types/Billing/MeteredPlan/ServerMeteredPlan.ts index 3069d0112f..da16d1a77e 100644 --- a/Common/Server/Types/Billing/MeteredPlan/ServerMeteredPlan.ts +++ b/Common/Server/Types/Billing/MeteredPlan/ServerMeteredPlan.ts @@ -16,6 +16,7 @@ export default class ServerMeteredPlan { return meteredPlan.getPricePerUnit() * quantity; } + @CaptureSpan() public async reportQuantityToBillingProvider( _projectId: ObjectID, _options: { diff --git a/Common/Server/Types/Workflow/ComponentCode.ts b/Common/Server/Types/Workflow/ComponentCode.ts index 33e642ccff..3c5bbcf0a6 100644 --- a/Common/Server/Types/Workflow/ComponentCode.ts +++ b/Common/Server/Types/Workflow/ComponentCode.ts @@ -36,6 +36,7 @@ export default class ComponentCode { return this.metadata; } + @CaptureSpan() public async run( _args: JSONObject, _options: RunOptions, diff --git a/Common/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts b/Common/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts index 656bb17538..00441b97d0 100644 --- a/Common/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts +++ b/Common/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts @@ -153,6 +153,7 @@ export default class OnTriggerBaseModel< }; } + @CaptureSpan() public async initTrigger( req: ExpressRequest, res: ExpressResponse, diff --git a/Common/Server/Types/Workflow/Components/Webhook.ts b/Common/Server/Types/Workflow/Components/Webhook.ts index 113f40df29..e0ed776c00 100644 --- a/Common/Server/Types/Workflow/Components/Webhook.ts +++ b/Common/Server/Types/Workflow/Components/Webhook.ts @@ -75,6 +75,7 @@ export default class WebhookTrigger extends TriggerCode { ); } + @CaptureSpan() public async initTrigger( req: ExpressRequest, res: ExpressResponse, diff --git a/Common/Server/Types/Workflow/TriggerCode.ts b/Common/Server/Types/Workflow/TriggerCode.ts index dddc7eaa17..c27aa9c00a 100644 --- a/Common/Server/Types/Workflow/TriggerCode.ts +++ b/Common/Server/Types/Workflow/TriggerCode.ts @@ -68,6 +68,7 @@ export default class TriggerCode extends ComponentCode { }; } + @CaptureSpan() public async setupComponent(props: InitProps): Promise { this.executeWorkflow = props.executeWorkflow; this.scheduleWorkflow = props.scheduleWorkflow; @@ -76,10 +77,12 @@ export default class TriggerCode extends ComponentCode { return await this.init(props); } + @CaptureSpan() public async init(_props: InitProps): Promise { return await Promise.resolve(); } + @CaptureSpan() public async update(_props: UpdateProps): Promise { return await Promise.resolve(); } diff --git a/Common/Server/Utils/AnalyticsDatabase/StatementGenerator.ts b/Common/Server/Utils/AnalyticsDatabase/StatementGenerator.ts index 15fb12b6d8..7f6181c53a 100644 --- a/Common/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +++ b/Common/Server/Utils/AnalyticsDatabase/StatementGenerator.ts @@ -579,6 +579,7 @@ export default class StatementGenerator { }' AND name = '${columnName}'`; } + @CaptureSpan() public async toRenameColumnStatement( oldColumnName: string, newColumnName: string, diff --git a/Common/Server/Utils/CodeRepository/GitHub/GitHub.ts b/Common/Server/Utils/CodeRepository/GitHub/GitHub.ts index 67b7d79093..b1bb617e79 100644 --- a/Common/Server/Utils/CodeRepository/GitHub/GitHub.ts +++ b/Common/Server/Utils/CodeRepository/GitHub/GitHub.ts @@ -48,6 +48,7 @@ export default class GitHubUtil extends HostedCodeRepository { }; } + @CaptureSpan() public async getPullRequestByNumber(data: { organizationName: string; repositoryName: string; diff --git a/Common/Server/Utils/CodeRepository/HostedCodeRepository/HostedCodeRepository.ts b/Common/Server/Utils/CodeRepository/HostedCodeRepository/HostedCodeRepository.ts index bec1ead792..1292825715 100644 --- a/Common/Server/Utils/CodeRepository/HostedCodeRepository/HostedCodeRepository.ts +++ b/Common/Server/Utils/CodeRepository/HostedCodeRepository/HostedCodeRepository.ts @@ -21,6 +21,7 @@ export default class HostedCodeRepository { public authToken: string = ""; public username: string = ""; + @CaptureSpan() public async getPullRequests(_data: { pullRequestState: PullRequestState; baseBranchName?: string | undefined; @@ -30,6 +31,7 @@ export default class HostedCodeRepository { throw new NotImplementedException(); } + @CaptureSpan() public async createPullRequest(_data: { baseBranchName: string; headBranchName: string; @@ -41,6 +43,7 @@ export default class HostedCodeRepository { throw new NotImplementedException(); } + @CaptureSpan() public async pushChanges(_data: { branchName: string; organizationName: string; @@ -49,6 +52,7 @@ export default class HostedCodeRepository { throw new NotImplementedException(); } + @CaptureSpan() public async addRemote(_data: { remoteName: string; organizationName: string; diff --git a/Common/Server/Utils/Monitor/Criteria/CompareCriteria.ts b/Common/Server/Utils/Monitor/Criteria/CompareCriteria.ts index 5913506897..b5fcfeee4a 100644 --- a/Common/Server/Utils/Monitor/Criteria/CompareCriteria.ts +++ b/Common/Server/Utils/Monitor/Criteria/CompareCriteria.ts @@ -6,6 +6,7 @@ import { FilterType, } from "Common/Types/Monitor/CriteriaFilter"; import Typeof from "Common/Types/Typeof"; +import CaptureSpan from "../../Telemetry/CaptureSpan"; export default class CompareCriteria { @CaptureSpan() diff --git a/Common/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts b/Common/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts index 4e59107818..f287131be9 100644 --- a/Common/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts +++ b/Common/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts @@ -12,6 +12,7 @@ import ObjectID from "Common/Types/ObjectID"; import Metric from "../../../../Models/AnalyticsModels/Metric"; import MonitorMetricTypeUtil from "../../../../Utils/Monitor/MonitorMetricType"; import MetricService from "../../../Services/MetricService"; +import CaptureSpan from "../../Telemetry/CaptureSpan"; export default class EvaluateOverTime { @CaptureSpan() diff --git a/Common/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.ts b/Common/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.ts index bfe60b85ab..61428eca25 100644 --- a/Common/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.ts +++ b/Common/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.ts @@ -12,6 +12,7 @@ import Typeof from "Common/Types/Typeof"; import EvaluateOverTime from "./EvaluateOverTime"; import CompareCriteria from "./CompareCriteria"; import ProbeMonitorResponse from "Common/Types/Probe/ProbeMonitorResponse"; +import CaptureSpan from "../../Telemetry/CaptureSpan"; export default class IncomingRequestCriteria { @CaptureSpan() diff --git a/Common/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts b/Common/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts index 054886fce8..dd39b127e7 100644 --- a/Common/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +++ b/Common/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts @@ -11,6 +11,7 @@ import { CriteriaFilter, EvaluateOverTimeType, } from "Common/Types/Monitor/CriteriaFilter"; +import CaptureSpan from "../../Telemetry/CaptureSpan"; export default class MetricMonitorCriteria { @CaptureSpan() diff --git a/Common/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.ts b/Common/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.ts index 7b0417cdcb..66e153a11e 100644 --- a/Common/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.ts +++ b/Common/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.ts @@ -9,6 +9,7 @@ import { import SslMonitorResponse from "Common/Types/Monitor/SSLMonitor/SslMonitorResponse"; import ProbeMonitorResponse from "Common/Types/Probe/ProbeMonitorResponse"; import EvaluateOverTime from "./EvaluateOverTime"; +import CaptureSpan from "../../Telemetry/CaptureSpan"; export default class ServerMonitorCriteria { @CaptureSpan() diff --git a/Common/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.ts b/Common/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.ts index fdb6c5b7f3..2c5bf274c6 100644 --- a/Common/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.ts +++ b/Common/Server/Utils/Monitor/Criteria/TraceMonitorCriteria.ts @@ -5,7 +5,7 @@ import CompareCriteria from "./CompareCriteria"; import { CheckOn, CriteriaFilter } from "Common/Types/Monitor/CriteriaFilter"; export default class TraceMonitorCriteria { - @CaptureSpan() +@CaptureSpan() public static async isMonitorInstanceCriteriaFilterMet(input: { dataToProcess: DataToProcess; criteriaFilter: CriteriaFilter; diff --git a/Common/Server/Utils/Telemetry/CaptureSpan.ts b/Common/Server/Utils/Telemetry/CaptureSpan.ts index 5893159141..06bdc2d4d6 100644 --- a/Common/Server/Utils/Telemetry/CaptureSpan.ts +++ b/Common/Server/Utils/Telemetry/CaptureSpan.ts @@ -129,4 +129,4 @@ function CaptureSpan(data?: { }; } -export default CaptureSpan; \ No newline at end of file +export default CaptureSpan; diff --git a/Dashboard/src/Pages/Monitor/SideMenu.tsx b/Dashboard/src/Pages/Monitor/SideMenu.tsx index 5b4ec5fa40..d6ff32d57c 100644 --- a/Dashboard/src/Pages/Monitor/SideMenu.tsx +++ b/Dashboard/src/Pages/Monitor/SideMenu.tsx @@ -115,9 +115,6 @@ const DashboardSideMenu: FunctionComponent = ( }} /> - - - = ( title: "Microsoft Teams", to: RouteUtil.populateRouteParams( RouteMap[ - PageMap.MONITORS_WORKSPACE_CONNECTION_MICROSOFT_TEAMS + PageMap.MONITORS_WORKSPACE_CONNECTION_MICROSOFT_TEAMS ] as Route, ), }} icon={IconProp.MicrosoftTeams} /> - );