Skip to content

Commit

Permalink
Merge branch 'hotfix/v1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
matterlobby committed Nov 19, 2020
2 parents 643b852 + f7de45c commit 32ca944
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions prometheus-exporter/prometheus-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ module.exports = {
}
},
addCounter: function (metricConfig) {
metricConfig.registers = [customRegistry];
const metric = new client.Counter(metricConfig);
customRegistry.registerMetric(metric);
red.log.info('Added Prometheus Counter ' + metricConfig.name + ' ' + JSON.stringify(metricConfig, null, 2));
return metric;
},
addGauge: function (metricConfig) {
metricConfig.registers = [customRegistry];
const metric = new client.Gauge(metricConfig);
customRegistry.registerMetric(metric);
red.log.info('Added Prometheus Gauge ' + metricConfig.name+ ' ' + JSON.stringify(metricConfig, null, 2));
return metric;
},
Expand Down
4 changes: 3 additions & 1 deletion prometheus-exporter/prometheus-metric-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function (RED) {
function PrometheusMetricConfigNode(config) {
RED.nodes.createNode(this, config);
let node = this;
RED.log.debug('Instanciating PrometheusMetricConfigNode', node.id);
RED.log.info('Instanciating PrometheusMetricConfigNode ' + config.name);

node.name = config.name;
node.help = config.help;
Expand All @@ -20,6 +20,7 @@ module.exports = function (RED) {
}

this.on('close', function () {
RED.log.info('Closing PrometheusMetricConfigNode ' + config.name);
try {
exporter.removeMetric(node.name);
} catch (error) {
Expand All @@ -29,6 +30,7 @@ module.exports = function (RED) {
}

function registerMetric(node) {
RED.log.info('PrometheusMetricConfigNode.registerMetric ' + node.name);
let labelsList = undefined;
if (node.labels) {
let splitLabels = node.labels.split(',');
Expand Down

0 comments on commit 32ca944

Please sign in to comment.