mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 06:40:39 +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({
|
||||
key: "attributes",
|
||||
title: "Attributes",
|
||||
|
@ -971,5 +971,4 @@ export default class TelemetryException extends DatabaseBaseModel {
|
||||
default: 1,
|
||||
})
|
||||
public occuranceCount?: number = undefined;
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
import LocalCache from "../Infrastructure/LocalCache";
|
||||
import Express, {
|
||||
ExpressRequest,
|
||||
|
@ -25,7 +25,7 @@ export class MigrationName1724613666632 implements MigrationInterface {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "TelemetryException" ADD "isArchived" boolean NOT NULL DEFAULT false`,
|
||||
);
|
||||
|
||||
|
||||
await queryRunner.query(
|
||||
`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";
|
||||
|
||||
export class MigrationName1724659071843 implements MigrationInterface {
|
||||
public name = 'MigrationName1724659071843'
|
||||
public name = "MigrationName1724659071843";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
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 up(queryRunner: QueryRunner): Promise<void> {
|
||||
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"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -91,5 +91,5 @@ export default [
|
||||
MigrationName1724078044172,
|
||||
MigrationName1724610006927,
|
||||
MigrationName1724613666632,
|
||||
MigrationName1724659071843
|
||||
MigrationName1724659071843,
|
||||
];
|
||||
|
@ -33,9 +33,9 @@ export type Span = opentelemetry.api.Span;
|
||||
export type SpanStatus = opentelemetry.api.SpanStatus;
|
||||
|
||||
export enum SpanStatusCode {
|
||||
UNSET = 0,
|
||||
OK = 1,
|
||||
ERROR = 2
|
||||
UNSET = 0,
|
||||
OK = 1,
|
||||
ERROR = 2,
|
||||
}
|
||||
|
||||
export default class Telemetry {
|
||||
|
@ -76,7 +76,15 @@ router.get(
|
||||
//get list of monitors to be monitored
|
||||
const monitorProbes: Array<MonitorProbe> =
|
||||
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: {
|
||||
nextPingAt: SortOrder.Ascending,
|
||||
},
|
||||
@ -229,7 +237,15 @@ router.get(
|
||||
//get list of monitors to be monitored
|
||||
const firstMonitorToBeFetched: MonitorProbe | null =
|
||||
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: {
|
||||
nextPingAt: true,
|
||||
monitorId: true,
|
||||
|
@ -308,17 +308,21 @@ router.post(
|
||||
exception.traceId = dbSpan.traceId;
|
||||
exception.time = eventTime;
|
||||
exception.timeUnixNano = eventTimeUnixNano;
|
||||
exception.message = (eventAttributes["exception.message"] as string) || "";
|
||||
exception.stackTrace = (eventAttributes["exception.stacktrace"] as string) || "";
|
||||
exception.exceptionType = (eventAttributes["exception.type"] as string) || "";
|
||||
exception.escaped = (eventAttributes["exception.escaped"] as boolean) || false;
|
||||
exception.message =
|
||||
(eventAttributes["exception.message"] as string) || "";
|
||||
exception.stackTrace =
|
||||
(eventAttributes["exception.stacktrace"] as string) || "";
|
||||
exception.exceptionType =
|
||||
(eventAttributes["exception.type"] as string) || "";
|
||||
exception.escaped =
|
||||
(eventAttributes["exception.escaped"] as boolean) || false;
|
||||
const exceptionAttributes: JSONObject = {
|
||||
...eventAttributes,
|
||||
};
|
||||
|
||||
for(const keys of Object.keys(exceptionAttributes)) {
|
||||
// delete all keys that start with exception to avoid duplicate keys because we already saved it.
|
||||
if(keys.startsWith("exception.")) {
|
||||
for (const keys of Object.keys(exceptionAttributes)) {
|
||||
// delete all keys that start with exception to avoid duplicate keys because we already saved it.
|
||||
if (keys.startsWith("exception.")) {
|
||||
delete exceptionAttributes[keys];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user