@adalo/metrics 0.1.114 → 0.1.115
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/lib/baseMetricsClient.d.ts +171 -0
- package/lib/baseMetricsClient.d.ts.map +1 -0
- package/lib/baseMetricsClient.js +353 -0
- package/lib/baseMetricsClient.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -1
- package/lib/metricsClient.d.ts +11 -169
- package/lib/metricsClient.d.ts.map +1 -1
- package/lib/metricsClient.js +80 -350
- package/lib/metricsClient.js.map +1 -1
- package/lib/metricsDatabaseClient.d.ts +10 -12
- package/lib/metricsDatabaseClient.d.ts.map +1 -1
- package/lib/metricsDatabaseClient.js +11 -13
- package/lib/metricsDatabaseClient.js.map +1 -1
- package/lib/metricsQueueRedisClient.d.ts +1 -1
- package/lib/metricsQueueRedisClient.d.ts.map +1 -1
- package/lib/metricsQueueRedisClient.js +11 -12
- package/lib/metricsQueueRedisClient.js.map +1 -1
- package/lib/metricsRedisClient.d.ts +14 -16
- package/lib/metricsRedisClient.d.ts.map +1 -1
- package/lib/metricsRedisClient.js +15 -17
- package/lib/metricsRedisClient.js.map +1 -1
- package/package.json +1 -1
- package/src/baseMetricsClient.js +411 -0
- package/src/index.ts +1 -0
- package/src/metricsClient.js +82 -412
- package/src/metricsDatabaseClient.js +10 -12
- package/src/metricsQueueRedisClient.js +11 -12
- package/src/metricsRedisClient.js +14 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { BaseMetricsClient } = require('./baseMetricsClient')
|
|
2
2
|
const {
|
|
3
3
|
getRedisClientType,
|
|
4
4
|
REDIS_V4,
|
|
@@ -10,26 +10,25 @@ const redisConnectionStableFields = ['name', 'flags', 'cmd']
|
|
|
10
10
|
const redisConnectionFields = ['name', 'flags', 'tot-mem', 'cmd']
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* RedisMetricsClient extends
|
|
13
|
+
* RedisMetricsClient extends BaseMetricsClient to collect
|
|
14
14
|
* Redis metrics periodically and push them to Prometheus Pushgateway.
|
|
15
15
|
*
|
|
16
|
-
* @extends
|
|
16
|
+
* @extends BaseMetricsClient
|
|
17
17
|
*/
|
|
18
|
-
class RedisMetricsClient extends
|
|
18
|
+
class RedisMetricsClient extends BaseMetricsClient {
|
|
19
19
|
/**
|
|
20
20
|
* @param {Object} options
|
|
21
21
|
* @param {any} options.redisClient - Redis client instance (required)
|
|
22
|
-
* @param {string} [options.appName] - Application name (from
|
|
23
|
-
* @param {string} [options.dynoId] - Dyno/instance ID (from
|
|
24
|
-
* @param {string} [options.processType] - Process type (from
|
|
25
|
-
* @param {boolean} [options.enabled] - Enable metrics collection (from
|
|
26
|
-
* @param {boolean} [options.logValues] - Log metrics values (from
|
|
27
|
-
* @param {string} [options.pushgatewayUrl] - PushGateway URL (from
|
|
28
|
-
* @param {string} [options.pushgatewaySecret] - PushGateway secret token (from
|
|
29
|
-
* @param {number} [options.intervalSec] - Interval in seconds for pushing metrics (from
|
|
30
|
-
* @param {boolean} [options.removeOldMetrics] - Remove old metrics by service (from
|
|
31
|
-
* @param {
|
|
32
|
-
* @param {function} [options.startupValidation] - Function to validate startup (from MetricsClient)
|
|
22
|
+
* @param {string} [options.appName] - Application name (from BaseMetricsClient)
|
|
23
|
+
* @param {string} [options.dynoId] - Dyno/instance ID (from BaseMetricsClient)
|
|
24
|
+
* @param {string} [options.processType] - Process type (from BaseMetricsClient)
|
|
25
|
+
* @param {boolean} [options.enabled] - Enable metrics collection (from BaseMetricsClient)
|
|
26
|
+
* @param {boolean} [options.logValues] - Log metrics values (from BaseMetricsClient)
|
|
27
|
+
* @param {string} [options.pushgatewayUrl] - PushGateway URL (from BaseMetricsClient)
|
|
28
|
+
* @param {string} [options.pushgatewaySecret] - PushGateway secret token (from BaseMetricsClient)
|
|
29
|
+
* @param {number} [options.intervalSec] - Interval in seconds for pushing metrics (from BaseMetricsClient)
|
|
30
|
+
* @param {boolean} [options.removeOldMetrics] - Remove old metrics by service (from BaseMetricsClient)
|
|
31
|
+
* @param {function} [options.startupValidation] - Function to validate startup (from BaseMetricsClient)
|
|
33
32
|
*/
|
|
34
33
|
constructor({ redisClient, ...metricsConfig } = {}) {
|
|
35
34
|
const intervalSec =
|
|
@@ -39,7 +38,6 @@ class RedisMetricsClient extends MetricsClient {
|
|
|
39
38
|
|
|
40
39
|
super({
|
|
41
40
|
...metricsConfig,
|
|
42
|
-
scripDefaultMetrics: true,
|
|
43
41
|
processType: metricsConfig.processType || 'queue-metrics',
|
|
44
42
|
intervalSec,
|
|
45
43
|
})
|