Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #10 from guilhermecarneiroo/addExporterPrefix
Browse files Browse the repository at this point in the history
Add exporter prefix in metric name
  • Loading branch information
guilhermecarneiroo authored Dec 19, 2018
2 parents f59d159 + c3fec3c commit 0c168de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/prometheus/metric-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 0c168de

Please sign in to comment.