@abyss-project/monitor 1.0.45 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/types/interface/api/requests/infrastructure.admin.request.d.ts +1 -0
- package/dist/types/interface/api/responses/report.admin.response.d.ts +46 -36
- package/dist/types/interface/models/application-cron-task-history.model.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const API_KEY_APPLICATION_HEADER = "abyss-monitor-api-key-applica
|
|
|
13
13
|
export declare const ADMIN_TOKEN_HEADER = "abyss-admin-token";
|
|
14
14
|
export declare const HEADER_CRON_TASK_SIGNATURE_NAME = "abyss-monitor-cron-task-signature";
|
|
15
15
|
export declare const CRON_TASK_SIGNATURE_ALGORITHM = "sha256";
|
|
16
|
+
export declare const MAX_RESPONSE_DATA_SIZE = 10240;
|
|
16
17
|
export declare const HEADER_WEBHOOK_SIGNATURE_NAME = "abyss-monitor-webhook-signature";
|
|
17
18
|
export declare const WEBHOOK_SIGNATURE_ALGORITHM = "sha256";
|
|
18
19
|
export declare const NUMBER_RETRY_API = 10;
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
};
|
|
31
31
|
var _a;
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.AbyssMonitorCore = exports.RETRY_CODES = exports.BASE_DELAY_BETWEEN_RETRY = exports.NUMBER_RETRY_API = exports.WEBHOOK_SIGNATURE_ALGORITHM = exports.HEADER_WEBHOOK_SIGNATURE_NAME = exports.CRON_TASK_SIGNATURE_ALGORITHM = exports.HEADER_CRON_TASK_SIGNATURE_NAME = exports.ADMIN_TOKEN_HEADER = exports.API_KEY_APPLICATION_HEADER = void 0;
|
|
33
|
+
exports.AbyssMonitorCore = exports.RETRY_CODES = exports.BASE_DELAY_BETWEEN_RETRY = exports.NUMBER_RETRY_API = exports.WEBHOOK_SIGNATURE_ALGORITHM = exports.HEADER_WEBHOOK_SIGNATURE_NAME = exports.MAX_RESPONSE_DATA_SIZE = exports.CRON_TASK_SIGNATURE_ALGORITHM = exports.HEADER_CRON_TASK_SIGNATURE_NAME = exports.ADMIN_TOKEN_HEADER = exports.API_KEY_APPLICATION_HEADER = void 0;
|
|
34
34
|
require("reflect-metadata");
|
|
35
35
|
const axios_1 = __importDefault(require("axios"));
|
|
36
36
|
const axios_retry_1 = __importStar(require("axios-retry"));
|
|
@@ -47,6 +47,7 @@ exports.API_KEY_APPLICATION_HEADER = 'abyss-monitor-api-key-application';
|
|
|
47
47
|
exports.ADMIN_TOKEN_HEADER = 'abyss-admin-token';
|
|
48
48
|
exports.HEADER_CRON_TASK_SIGNATURE_NAME = 'abyss-monitor-cron-task-signature';
|
|
49
49
|
exports.CRON_TASK_SIGNATURE_ALGORITHM = 'sha256';
|
|
50
|
+
exports.MAX_RESPONSE_DATA_SIZE = 10240;
|
|
50
51
|
exports.HEADER_WEBHOOK_SIGNATURE_NAME = 'abyss-monitor-webhook-signature';
|
|
51
52
|
exports.WEBHOOK_SIGNATURE_ALGORITHM = 'sha256';
|
|
52
53
|
exports.NUMBER_RETRY_API = 10;
|
|
@@ -1,42 +1,52 @@
|
|
|
1
1
|
import { LogLevel } from '../../../enum';
|
|
2
|
+
export interface RequestsByMonth {
|
|
3
|
+
month: number;
|
|
4
|
+
count: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ErrorsByStatusCode {
|
|
7
|
+
statusCode: number;
|
|
8
|
+
count: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TopErrorEndpoint {
|
|
11
|
+
endpoint: string;
|
|
12
|
+
count: number;
|
|
13
|
+
}
|
|
14
|
+
export interface LogsByMonth {
|
|
15
|
+
month: number;
|
|
16
|
+
level: LogLevel;
|
|
17
|
+
count: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ApplicationMetrics {
|
|
20
|
+
totalRequests: number;
|
|
21
|
+
totalErrors: number;
|
|
22
|
+
totalWarnings: number;
|
|
23
|
+
averageResponseTime: number;
|
|
24
|
+
peakRequestsPerDay: number;
|
|
25
|
+
mostUsedEndpoint: string;
|
|
26
|
+
errorRate: number;
|
|
27
|
+
availabilityRate: number;
|
|
28
|
+
requestsByMonth: Array<RequestsByMonth>;
|
|
29
|
+
errorsByStatusCode: Array<ErrorsByStatusCode>;
|
|
30
|
+
topErrorEndpoints: Array<TopErrorEndpoint>;
|
|
31
|
+
totalLogs: number;
|
|
32
|
+
totalCronTasks: number;
|
|
33
|
+
successfulCronTasks: number;
|
|
34
|
+
failedCronTasks: number;
|
|
35
|
+
totalEvents: number;
|
|
36
|
+
totalWebhooks: number;
|
|
37
|
+
successfulWebhooks: number;
|
|
38
|
+
failedWebhooks: number;
|
|
39
|
+
totalSentinelChecks: number;
|
|
40
|
+
successfulSentinelChecks: number;
|
|
41
|
+
failedSentinelChecks: number;
|
|
42
|
+
logsByMonth: Array<LogsByMonth>;
|
|
43
|
+
}
|
|
2
44
|
export interface GetReportAdminResponse {
|
|
3
45
|
data: {
|
|
4
|
-
metrics: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
averageResponseTime: number;
|
|
9
|
-
peakRequestsPerDay: number;
|
|
10
|
-
mostUsedEndpoint: string;
|
|
11
|
-
errorRate: number;
|
|
12
|
-
availabilityRate: number;
|
|
13
|
-
requestsByMonth: Array<{
|
|
14
|
-
month: number;
|
|
15
|
-
count: number;
|
|
16
|
-
}>;
|
|
17
|
-
errorsByStatusCode: Array<{
|
|
18
|
-
statusCode: number;
|
|
19
|
-
count: number;
|
|
20
|
-
}>;
|
|
21
|
-
topErrorEndpoints: Array<{
|
|
22
|
-
endpoint: string;
|
|
23
|
-
count: number;
|
|
24
|
-
}>;
|
|
25
|
-
totalLogs: number;
|
|
26
|
-
totalCronTasks: number;
|
|
27
|
-
successfulCronTasks: number;
|
|
28
|
-
failedCronTasks: number;
|
|
29
|
-
totalEvents: number;
|
|
30
|
-
totalWebhooks: number;
|
|
31
|
-
successfulWebhooks: number;
|
|
32
|
-
failedWebhooks: number;
|
|
33
|
-
totalSentinelChecks: number;
|
|
34
|
-
successfulSentinelChecks: number;
|
|
35
|
-
failedSentinelChecks: number;
|
|
36
|
-
logsByMonth: Array<{
|
|
37
|
-
month: number;
|
|
38
|
-
level: LogLevel;
|
|
39
|
-
count: number;
|
|
46
|
+
metrics: ApplicationMetrics & {
|
|
47
|
+
metricsByApplication: Array<ApplicationMetrics & {
|
|
48
|
+
applicationId: string;
|
|
49
|
+
applicationName: string;
|
|
40
50
|
}>;
|
|
41
51
|
};
|
|
42
52
|
};
|
|
@@ -5,6 +5,12 @@ export interface IApplicationCronTaskHistory {
|
|
|
5
5
|
startDate: Date;
|
|
6
6
|
requestId: string | null;
|
|
7
7
|
hasFailed: boolean | null;
|
|
8
|
+
responseStatusCode: number | null;
|
|
9
|
+
responseData: string | null;
|
|
10
|
+
responseHeaders: string | null;
|
|
11
|
+
responseTimeMs: number | null;
|
|
12
|
+
errorMessage: string | null;
|
|
13
|
+
retryCount: number | null;
|
|
8
14
|
updatedAt?: Date;
|
|
9
15
|
createdAt?: Date;
|
|
10
16
|
applicationCronTask?: IApplicationCronTask;
|