mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 14:49:07 +00:00
refactor: Update telemetry exception view layout components
This commit is contained in:
parent
cc7696f481
commit
185eb20d1b
@ -298,7 +298,6 @@ export default class ExceptionInstance extends AnalyticsBaseModel {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
||||||
new AnalyticsTableColumn({
|
new AnalyticsTableColumn({
|
||||||
key: "attributes",
|
key: "attributes",
|
||||||
title: "Attributes",
|
title: "Attributes",
|
||||||
|
@ -971,5 +971,4 @@ export default class TelemetryException extends DatabaseBaseModel {
|
|||||||
default: 1,
|
default: 1,
|
||||||
})
|
})
|
||||||
public occuranceCount?: number = undefined;
|
public occuranceCount?: number = undefined;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import LocalCache from "../Infrastructure/LocalCache";
|
import LocalCache from "../Infrastructure/LocalCache";
|
||||||
import Express, {
|
import Express, {
|
||||||
ExpressRequest,
|
ExpressRequest,
|
||||||
|
@ -25,7 +25,7 @@ export class MigrationName1724613666632 implements MigrationInterface {
|
|||||||
await queryRunner.query(
|
await queryRunner.query(
|
||||||
`ALTER TABLE "TelemetryException" ADD "isArchived" boolean NOT NULL DEFAULT false`,
|
`ALTER TABLE "TelemetryException" ADD "isArchived" boolean NOT NULL DEFAULT false`,
|
||||||
);
|
);
|
||||||
|
|
||||||
await queryRunner.query(
|
await queryRunner.query(
|
||||||
`ALTER TABLE "TelemetryException" ADD CONSTRAINT "FK_3def22373f0cb84e16cb355b5e5" FOREIGN KEY ("markedAsArchivedByUserId") REFERENCES "User"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
`ALTER TABLE "TelemetryException" ADD CONSTRAINT "FK_3def22373f0cb84e16cb355b5e5" FOREIGN KEY ("markedAsArchivedByUserId") REFERENCES "User"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
||||||
);
|
);
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
export class MigrationName1724659071843 implements MigrationInterface {
|
export class MigrationName1724659071843 implements MigrationInterface {
|
||||||
public name = 'MigrationName1724659071843'
|
public name = "MigrationName1724659071843";
|
||||||
|
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
await queryRunner.query(`ALTER TABLE "TelemetryException" ADD "occuranceCount" integer NOT NULL DEFAULT '1'`);
|
await queryRunner.query(
|
||||||
}
|
`ALTER TABLE "TelemetryException" ADD "occuranceCount" integer NOT NULL DEFAULT '1'`,
|
||||||
|
);
|
||||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
}
|
||||||
await queryRunner.query(`ALTER TABLE "TelemetryException" DROP COLUMN "occuranceCount"`);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "TelemetryException" DROP COLUMN "occuranceCount"`,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,5 +91,5 @@ export default [
|
|||||||
MigrationName1724078044172,
|
MigrationName1724078044172,
|
||||||
MigrationName1724610006927,
|
MigrationName1724610006927,
|
||||||
MigrationName1724613666632,
|
MigrationName1724613666632,
|
||||||
MigrationName1724659071843
|
MigrationName1724659071843,
|
||||||
];
|
];
|
||||||
|
@ -33,9 +33,9 @@ export type Span = opentelemetry.api.Span;
|
|||||||
export type SpanStatus = opentelemetry.api.SpanStatus;
|
export type SpanStatus = opentelemetry.api.SpanStatus;
|
||||||
|
|
||||||
export enum SpanStatusCode {
|
export enum SpanStatusCode {
|
||||||
UNSET = 0,
|
UNSET = 0,
|
||||||
OK = 1,
|
OK = 1,
|
||||||
ERROR = 2
|
ERROR = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Telemetry {
|
export default class Telemetry {
|
||||||
|
@ -76,7 +76,15 @@ router.get(
|
|||||||
//get list of monitors to be monitored
|
//get list of monitors to be monitored
|
||||||
const monitorProbes: Array<MonitorProbe> =
|
const monitorProbes: Array<MonitorProbe> =
|
||||||
await MonitorProbeService.findBy({
|
await MonitorProbeService.findBy({
|
||||||
query: getMonitorFetchQuery(new ObjectID(req.params["probeId"])),
|
query: {
|
||||||
|
...getMonitorFetchQuery(new ObjectID(req.params["probeId"])),
|
||||||
|
nextPingAt: QueryHelper.lessThanEqualToOrNull(
|
||||||
|
OneUptimeDate.addRemoveMinutes(
|
||||||
|
OneUptimeDate.getCurrentDate(),
|
||||||
|
-3,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
},
|
||||||
sort: {
|
sort: {
|
||||||
nextPingAt: SortOrder.Ascending,
|
nextPingAt: SortOrder.Ascending,
|
||||||
},
|
},
|
||||||
@ -229,7 +237,15 @@ router.get(
|
|||||||
//get list of monitors to be monitored
|
//get list of monitors to be monitored
|
||||||
const firstMonitorToBeFetched: MonitorProbe | null =
|
const firstMonitorToBeFetched: MonitorProbe | null =
|
||||||
await MonitorProbeService.findOneBy({
|
await MonitorProbeService.findOneBy({
|
||||||
query: getMonitorFetchQuery(new ObjectID(req.params["probeId"])),
|
query: {
|
||||||
|
...getMonitorFetchQuery(new ObjectID(req.params["probeId"])),
|
||||||
|
nextPingAt: QueryHelper.lessThanEqualToOrNull(
|
||||||
|
OneUptimeDate.addRemoveMinutes(
|
||||||
|
OneUptimeDate.getCurrentDate(),
|
||||||
|
-3,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
},
|
||||||
select: {
|
select: {
|
||||||
nextPingAt: true,
|
nextPingAt: true,
|
||||||
monitorId: true,
|
monitorId: true,
|
||||||
|
@ -308,17 +308,21 @@ router.post(
|
|||||||
exception.traceId = dbSpan.traceId;
|
exception.traceId = dbSpan.traceId;
|
||||||
exception.time = eventTime;
|
exception.time = eventTime;
|
||||||
exception.timeUnixNano = eventTimeUnixNano;
|
exception.timeUnixNano = eventTimeUnixNano;
|
||||||
exception.message = (eventAttributes["exception.message"] as string) || "";
|
exception.message =
|
||||||
exception.stackTrace = (eventAttributes["exception.stacktrace"] as string) || "";
|
(eventAttributes["exception.message"] as string) || "";
|
||||||
exception.exceptionType = (eventAttributes["exception.type"] as string) || "";
|
exception.stackTrace =
|
||||||
exception.escaped = (eventAttributes["exception.escaped"] as boolean) || false;
|
(eventAttributes["exception.stacktrace"] as string) || "";
|
||||||
|
exception.exceptionType =
|
||||||
|
(eventAttributes["exception.type"] as string) || "";
|
||||||
|
exception.escaped =
|
||||||
|
(eventAttributes["exception.escaped"] as boolean) || false;
|
||||||
const exceptionAttributes: JSONObject = {
|
const exceptionAttributes: JSONObject = {
|
||||||
...eventAttributes,
|
...eventAttributes,
|
||||||
};
|
};
|
||||||
|
|
||||||
for(const keys of Object.keys(exceptionAttributes)) {
|
for (const keys of Object.keys(exceptionAttributes)) {
|
||||||
// delete all keys that start with exception to avoid duplicate keys because we already saved it.
|
// delete all keys that start with exception to avoid duplicate keys because we already saved it.
|
||||||
if(keys.startsWith("exception.")) {
|
if (keys.startsWith("exception.")) {
|
||||||
delete exceptionAttributes[keys];
|
delete exceptionAttributes[keys];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user