diff --git a/lib/prometheus.js b/lib/prometheus.js index 365fe25..26fcc1f 100644 --- a/lib/prometheus.js +++ b/lib/prometheus.js @@ -28,8 +28,8 @@ let uuid = require('uuid'), CONFIG_PUSH_GATEWAY_URL: 'pushGatewayUrl', // Defaults - DEFAULT_REQUEST_PHASES_DURATION_SECONDS: 'request_duration_seconds', - DEFAULT_CONNECTION_TIMINGS_SECONDS: 'connection_phases_seconds', + DEFAULT_REQUEST_DURATION_SECONDS: 'request_duration_seconds', + DEFAULT_REQUEST_WITH_PHASES_DURATION_SECONDS: 'request_with_phases_duration_seconds', DEFAULT_RUNNER_STATS: 'runnerStats', DEFAULT_MEASUREMENT_NAME: 'latency', DEFAULT_ERROR_MEASUREMENT_NAME: 'clientErrors', @@ -93,20 +93,21 @@ let uuid = require('uuid'), return scriptConfig; }, createPrometheusMeasurements: (config) => { - requestLatencyDuration = promClient.register.getSingleMetric(constants.DEFAULT_CONNECTION_TIMINGS_SECONDS) || + requestLatencyDuration = promClient.register.getSingleMetric(constants.DEFAULT_REQUEST_DURATION_SECONDS) || new promClient.Histogram({ - name: constants.DEFAULT_CONNECTION_TIMINGS_SECONDS, - help: 'Duration of connecti requests in seconds', + name: constants.DEFAULT_REQUEST_DURATION_SECONDS, + help: 'Duration of connection requests in seconds', labelNames: ['path', 'status_code', 'request_name'], buckets: config.bucketSizes || constants.DEFAULT_BUCKET_SIZE }); - requestPhaseDuration = new promClient.Histogram({ - name: constants.DEFAULT_REQUEST_PHASES_DURATION_SECONDS, - help: 'Duration of phases in the request in seconds', - labelNames: ['path', 'status_code', 'phase', 'request_name'], - buckets: config.bucketSizes || constants.DEFAULT_BUCKET_SIZE - }); + requestPhaseDuration = promClient.register.getSingleMetric(constants.DEFAULT_REQUEST_WITH_PHASES_DURATION_SECONDS) || + new promClient.Histogram({ + name: constants.DEFAULT_REQUEST_WITH_PHASES_DURATION_SECONDS, + help: 'Duration of phases in the request in seconds', + labelNames: ['path', 'status_code', 'phase', 'request_name'], + buckets: config.bucketSizes || constants.DEFAULT_BUCKET_SIZE + }); counterClientErrors = promClient.register.getSingleMetric(constants.DEFAULT_ERROR_MEASUREMENT_NAME) || new promClient.Counter({ diff --git a/package-lock.json b/package-lock.json index cad70dd..2660064 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "artillery-plugin-prometheus", - "version": "1.3.1", + "version": "1.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 21e44b8..86951b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "artillery-plugin-prometheus", - "version": "1.3.1", + "version": "1.3.2", "description": "Plugin for Artillery.IO that publishes response data into prometheus pushgateway.", "main": "index.js", "repository": {