From eadbe729e5c5ad14e016ad47f154a64a72395528 Mon Sep 17 00:00:00 2001 From: guilhermecarneiroo Date: Wed, 19 Dec 2018 09:12:16 -0200 Subject: [PATCH 1/2] Add exporter prefix in metric name --- src/plugins/prometheus/metric-type.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/prometheus/metric-type.js b/src/plugins/prometheus/metric-type.js index 2791446..44051f0 100644 --- a/src/plugins/prometheus/metric-type.js +++ b/src/plugins/prometheus/metric-type.js @@ -3,11 +3,12 @@ const client = require('prom-client'); const createCharts = (data) => { let index = 0; const metrics = []; + const EXPORTER_PREFIX = 'newrelic_insights_'; data.forEach((element) => { if (element.type === 'gauge') { metrics[index] = { chart: new client.Gauge({ - name: element.name, + name: EXPORTER_PREFIX + element.name, help: element.help, }), query: element.query, @@ -16,7 +17,7 @@ const createCharts = (data) => { } else if (element.type === 'counter') { metrics[index] = { chart: new client.Counter({ - name: element.name, + name: EXPORTER_PREFIX + element.name, help: element.help, }), query: element.query, From c3fec3c32c4910313bf3922a79745b00b1f02203 Mon Sep 17 00:00:00 2001 From: guilhermecarneiroo Date: Wed, 19 Dec 2018 09:15:10 -0200 Subject: [PATCH 2/2] 1.0.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 770be2e..648cae1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@contaazul/newrelic_insights_exporter", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 718a35c..68352f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@contaazul/newrelic_insights_exporter", - "version": "1.0.1", + "version": "1.0.2", "description": "New Relic insights exporter for Prometheus", "scripts": { "start": "node ./src/index.js",