@digital-alchemy/core 24.7.1 → 24.8.1
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/README.md +0 -2
- package/dist/extensions/cache.extension.js +9 -9
- package/dist/extensions/cache.extension.js.map +1 -1
- package/dist/extensions/configuration.extension.d.ts +2 -2
- package/dist/extensions/fetch.extension.d.ts +1 -1
- package/dist/extensions/fetch.extension.js +5 -5
- package/dist/extensions/fetch.extension.js.map +1 -1
- package/dist/extensions/index.d.ts +1 -0
- package/dist/extensions/index.js +1 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/internal.extension.d.ts +1 -1
- package/dist/extensions/is.extension.d.ts +1 -1
- package/dist/extensions/is.extension.js +3 -0
- package/dist/extensions/is.extension.js.map +1 -1
- package/dist/extensions/metrics.extension.d.ts +18 -0
- package/dist/extensions/metrics.extension.js +156 -0
- package/dist/extensions/metrics.extension.js.map +1 -0
- package/dist/extensions/scheduler.extension.js +9 -9
- package/dist/extensions/scheduler.extension.js.map +1 -1
- package/dist/extensions/wiring.extension.d.ts +16 -4
- package/dist/extensions/wiring.extension.js +31 -9
- package/dist/extensions/wiring.extension.js.map +1 -1
- package/dist/helpers/cache-memory.helper.d.ts +1 -1
- package/dist/helpers/cache-memory.helper.js +5 -6
- package/dist/helpers/cache-memory.helper.js.map +1 -1
- package/dist/helpers/cache-redis.helper.d.ts +1 -1
- package/dist/helpers/cache-redis.helper.js +6 -7
- package/dist/helpers/cache-redis.helper.js.map +1 -1
- package/dist/helpers/cache.helper.d.ts +1 -1
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/utilities.helper.d.ts +3 -0
- package/dist/helpers/utilities.helper.js +3 -0
- package/dist/helpers/utilities.helper.js.map +1 -1
- package/dist/helpers/wiring.helper.d.ts +9 -0
- package/dist/helpers/wiring.helper.js.map +1 -1
- package/package.json +24 -1
- package/dist/helpers/metrics.helper.d.ts +0 -69
- package/dist/helpers/metrics.helper.js +0 -132
- package/dist/helpers/metrics.helper.js.map +0 -1
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LOGGER_CONTEXT_ENTRIES_COUNT = exports.MEMORY_CACHE_ERROR_COUNT = exports.REDIS_OPERATION_LATENCY_MS = exports.REDIS_ERROR_COUNT = exports.FETCH_REQUESTS_FAILED = exports.FETCH_DOWNLOAD_REQUESTS_SUCCESSFUL = exports.FETCH_REQUESTS_SUCCESSFUL = exports.FETCH_REQUESTS_INITIATED = exports.CACHE_SET_OPERATIONS_TOTAL = exports.CACHE_DRIVER_ERROR_COUNT = exports.SCHEDULE_EXECUTION_TIME = exports.SCHEDULE_ERRORS = exports.SCHEDULE_EXECUTION_COUNT = exports.CACHE_GET_OPERATIONS_TOTAL = exports.CACHE_DELETE_OPERATIONS_TOTAL = void 0;
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
5
|
-
const prom_client_1 = require("prom-client");
|
|
6
|
-
/**
|
|
7
|
-
* Cache delete operations counter
|
|
8
|
-
*/
|
|
9
|
-
exports.CACHE_DELETE_OPERATIONS_TOTAL = new prom_client_1.Counter({
|
|
10
|
-
help: "Total number of cache delete operations",
|
|
11
|
-
labelNames: ["prefix", "key"],
|
|
12
|
-
name: "digital_alchemy_boilerplate_cache_delete_operations_total",
|
|
13
|
-
});
|
|
14
|
-
/**
|
|
15
|
-
* Cache get operations counter
|
|
16
|
-
*/
|
|
17
|
-
exports.CACHE_GET_OPERATIONS_TOTAL = new prom_client_1.Counter({
|
|
18
|
-
help: "Total number of cache get operations",
|
|
19
|
-
labelNames: ["prefix", "key", "hit_miss"],
|
|
20
|
-
name: "digital_alchemy_boilerplate_cache_get_operations_total",
|
|
21
|
-
});
|
|
22
|
-
/**
|
|
23
|
-
* Tracks the number of times a scheduled task has been executed.
|
|
24
|
-
* Labels:
|
|
25
|
-
* - context: The broader category or module the schedule belongs to.
|
|
26
|
-
* - label: A user-defined label to identify the specific schedule.
|
|
27
|
-
*/
|
|
28
|
-
exports.SCHEDULE_EXECUTION_COUNT = new prom_client_1.Counter({
|
|
29
|
-
help: "Counts the number of times a scheduled task has been executed",
|
|
30
|
-
labelNames: ["context", "label"],
|
|
31
|
-
name: "digital_alchemy_boilerplate_schedule_execution_count",
|
|
32
|
-
});
|
|
33
|
-
/**
|
|
34
|
-
* Counts the number of errors occurred during scheduled task executions.
|
|
35
|
-
* Labels:
|
|
36
|
-
* - context: The broader category or module the schedule belongs to.
|
|
37
|
-
* - label: A user-defined label to identify the specific schedule where the error occurred.
|
|
38
|
-
*/
|
|
39
|
-
exports.SCHEDULE_ERRORS = new prom_client_1.Counter({
|
|
40
|
-
help: "Counts the number of errors during scheduled task executions",
|
|
41
|
-
labelNames: ["context", "label"],
|
|
42
|
-
name: "digital_alchemy_boilerplate_schedule_errors",
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* Summary for Execution Time
|
|
46
|
-
*/
|
|
47
|
-
exports.SCHEDULE_EXECUTION_TIME = new prom_client_1.Summary({
|
|
48
|
-
help: "Measures the duration of each cron job or interval execution",
|
|
49
|
-
labelNames: ["context", "label"],
|
|
50
|
-
name: "digital_alchemy_boilerplate_schedule_execution_time",
|
|
51
|
-
// These percentiles are just examples; adjust them based on what's relevant for your analysis
|
|
52
|
-
percentiles: [0.5, 0.9, 0.99],
|
|
53
|
-
});
|
|
54
|
-
/**
|
|
55
|
-
* Metric to count errors in cache driver
|
|
56
|
-
*/
|
|
57
|
-
exports.CACHE_DRIVER_ERROR_COUNT = new prom_client_1.Counter({
|
|
58
|
-
help: "Counts the number of errors caught in the cache driver",
|
|
59
|
-
labelNames: ["methodName"],
|
|
60
|
-
name: "digital_alchemy_boilerplate_cache_driver_error_count",
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* Cache set operations counter
|
|
64
|
-
*/
|
|
65
|
-
exports.CACHE_SET_OPERATIONS_TOTAL = new prom_client_1.Counter({
|
|
66
|
-
help: "Total number of cache set operations",
|
|
67
|
-
labelNames: ["prefix", "key"],
|
|
68
|
-
name: "digital_alchemy_boilerplate_cache_set_operations_total",
|
|
69
|
-
});
|
|
70
|
-
/**
|
|
71
|
-
* Counts the total number of initiated fetch requests.
|
|
72
|
-
*/
|
|
73
|
-
exports.FETCH_REQUESTS_INITIATED = new prom_client_1.Counter({
|
|
74
|
-
help: "Total number of fetch requests that have been initiated",
|
|
75
|
-
name: "digital_alchemy_boilerplate_fetch_requests_initiated_total",
|
|
76
|
-
});
|
|
77
|
-
/**
|
|
78
|
-
* Counts the total number of successfully completed fetch requests.
|
|
79
|
-
*/
|
|
80
|
-
exports.FETCH_REQUESTS_SUCCESSFUL = new prom_client_1.Counter({
|
|
81
|
-
help: "Total number of fetch requests that have been successfully completed",
|
|
82
|
-
labelNames: ["context", "label"],
|
|
83
|
-
name: "digital_alchemy_boilerplate_fetch_requests_successful_total",
|
|
84
|
-
});
|
|
85
|
-
/**
|
|
86
|
-
* Counts the total number of successfully completed fetch requests.
|
|
87
|
-
*/
|
|
88
|
-
exports.FETCH_DOWNLOAD_REQUESTS_SUCCESSFUL = new prom_client_1.Counter({
|
|
89
|
-
help: "Total number of fetch download requests that have been successfully completed",
|
|
90
|
-
labelNames: ["context", "label"],
|
|
91
|
-
name: "digital_alchemy_boilerplate_fetch_download_requests_successful_total",
|
|
92
|
-
});
|
|
93
|
-
/**
|
|
94
|
-
* Counts the total number of failed fetch requests.
|
|
95
|
-
*/
|
|
96
|
-
exports.FETCH_REQUESTS_FAILED = new prom_client_1.Counter({
|
|
97
|
-
help: "Total number of fetch requests that have failed",
|
|
98
|
-
labelNames: ["context", "label"],
|
|
99
|
-
name: "digital_alchemy_boilerplate_fetch_requests_failed_total",
|
|
100
|
-
});
|
|
101
|
-
/**
|
|
102
|
-
* Gauge to count the number of errors encountered in Redis operations.
|
|
103
|
-
*/
|
|
104
|
-
exports.REDIS_ERROR_COUNT = new prom_client_1.Gauge({
|
|
105
|
-
help: "Counts the number of errors encountered in Redis operations",
|
|
106
|
-
name: "digital_alchemy_boilerplate_redis_error_count",
|
|
107
|
-
});
|
|
108
|
-
/**
|
|
109
|
-
* Histogram to track the latency of Redis operations in milliseconds.
|
|
110
|
-
* Buckets range from 0.1 ms to 1000 ms (1 second) for granular latency measurement.
|
|
111
|
-
*/
|
|
112
|
-
exports.REDIS_OPERATION_LATENCY_MS = new prom_client_1.Histogram({
|
|
113
|
-
buckets: [0.1, 0.5, 1, 5, 10, 20, 50, 100, 200, 500, 1000],
|
|
114
|
-
help: "Histogram for tracking the latency of Redis operations in milliseconds",
|
|
115
|
-
name: "digital_alchemy_boilerplate_redis_operation_latency_ms",
|
|
116
|
-
});
|
|
117
|
-
/**
|
|
118
|
-
* Counter to track the number of errors encountered in memory cache operations.
|
|
119
|
-
*/
|
|
120
|
-
exports.MEMORY_CACHE_ERROR_COUNT = new prom_client_1.Counter({
|
|
121
|
-
help: "Counts the number of errors encountered in memory cache operations",
|
|
122
|
-
name: "digital_alchemy_boilerplate_memory_cache_error_count",
|
|
123
|
-
});
|
|
124
|
-
/**
|
|
125
|
-
* A Prometheus gauge metric that tracks the number of unique context entries in the logger's context cache.
|
|
126
|
-
* This helps in monitoring and managing the memory usage associated with the caching of logger contexts.
|
|
127
|
-
*/
|
|
128
|
-
exports.LOGGER_CONTEXT_ENTRIES_COUNT = new prom_client_1.Gauge({
|
|
129
|
-
help: "Number of unique context entries in the logger context cache",
|
|
130
|
-
name: "digital_alchemy_boilerplate_logger_context_entries_count",
|
|
131
|
-
});
|
|
132
|
-
//# sourceMappingURL=metrics.helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.helper.js","sourceRoot":"","sources":["../../src/helpers/metrics.helper.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,6CAAiE;AAEjE;;GAEG;AACU,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