From da8b2f0ca2f6b4d4e9aa37414fbaf2cb87fc287d Mon Sep 17 00:00:00 2001 From: guilhermecarneiroo Date: Mon, 22 Oct 2018 10:20:04 -0200 Subject: [PATCH 01/11] adding contributing --- CONTRIBUTING.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c17c8bb --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,22 @@ +# **How to contribute to newrelic browser exporter** + +## **Project structure** + +``` +├── src/ +│ ├── app/ +│ │ ├── routes/ +│ │ │ └── metrics.js +│ │ ├── router.js +│ │ └── server.js +│ ├── plugins +│ │ ├── newrelic_browser +│ │ │ ├── javascriptErrorsPercent +│ │ │ ├── api-request.js +│ │ │ ├── index.js +│ │ ├── prometheus +│ │ └── index.js +│ │ +│ └── index.js + +``` From 0d13b13ee49d509b5272974abf055a1be7f5b599 Mon Sep 17 00:00:00 2001 From: guilhermecarneiroo Date: Wed, 24 Oct 2018 14:55:03 -0200 Subject: [PATCH 02/11] create contributing.md --- CONTRIBUTING.md | 138 ++++++++++++++++-- README.md | 6 +- .../javascriptErrorsPercent.js | 1 + 3 files changed, 127 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c17c8bb..e5b8f44 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,21 +2,129 @@ ## **Project structure** +### **application**: ``` -├── src/ -│ ├── app/ -│ │ ├── routes/ -│ │ │ └── metrics.js -│ │ ├── router.js -│ │ └── server.js -│ ├── plugins -│ │ ├── newrelic_browser -│ │ │ ├── javascriptErrorsPercent -│ │ │ ├── api-request.js -│ │ │ ├── index.js -│ │ ├── prometheus -│ │ └── index.js -│ │ -│ └── index.js +─ src/ + ├── app/ + │ ├── routes/ + │ │ └── metrics.js + │ ├── router.js + │ └── server.js + └── index.js +``` + +**src/app/routes/metrics.js** - Will be executed when the /metrics route is accessed. This code will start to collect data from newRelic plugin and output a string to [prometheus consuming](https://github.com/siimon/prom-client#register). + +**src/app/router.js** - Initialize /metrics route. + +**src/app/server.js** - Contains the code to start application and configure application routes. + +**src/index.js** - Start server methods. + +### **plugins**: +``` +─ src/ + └── plugins/ + ├── newrelic_browser/ + │ ├── javascriptErrorsPercent/ + │ └── api-request.js + └── prometheus/ + └── charts/ + ├── default.js + └── gauge.js +``` + +**newrelic_browser/** - Contains the code that will communicate with the API([api-request.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/plugins/newrelic_browser/api-request.js)) and the code that will initialize the prometheus chart and execute the callback after call to the API. + +**newrelic_browser/javascriptErrorsPercent/** - Contains the code that will create the javascript errors percent chart according prometheus model and the code that will be executed after the api response and set this data in chart. + +**newrelic_browser/api-requets** - Contains the code that will setup data before call newrelic api. API will return a unique value corresponding to the value of that data in the last minute. + +**prometheus/charts** - Contains the metric types used to create new chart. To know which metrics are supported by prometheus, see [metric types](https://prometheus.io/docs/concepts/metric_types/). + + +## **How to set up a new metric** + +Create a folder inside newrelic_browser. This folder shold be a file with a public method and callback method. The public method(In javascriptErrorsPercent this method is called collectData) will be initialize the chart if is the first call, like this: + +```js +const GaugeChart = require('../../prometheus/charts/gauge'); +let JSErrorsGauge; + +const collectData = () => new Promise((resolve, reject) => { + if (!JSErrorsGauge) { + JSErrorsGauge = new GaugeChart({ + name: 'newrelic_browser_javascript_errors_percent', + help: 'return a percentage of pageviews with javascript errors', + }); + } + + //... (hidden code) +} +module.exports = { + collectData, +}; ``` +Please read [prometheus best practices](https://prometheus.io/docs/practices/naming/) to name your chart configurations. + +After create the chart configuration you will need to set up the name and the value to retrieve specific metrics from this data. + +```js +//... +const collectData = () => new Promise((resolve, reject) => { + //... + + const names = 'EndUser/errors'; + const values = 'error_percentage'; + + //... +} +//... +``` + +Now you can call newrelic api passing these arguments and the callback that will be executed after api response and will set the metric value. +Code to call api: + +```js +//... +const collectData = () => new Promise((resolve, reject) => { + //... + + browser + .collectData(names, values) + .then((response) => { + onSuccess(response, resolve); + }) + .catch(reject); + +} +//... +``` +Callback method should set the metric collected from api request into chart(I this example, the chart is JSErrorsGauge): + +```js +//... +function onSuccess(response, resolve) { + const percentage = JSON.parse(response) + .metric_data.metrics[0] + .timeslices[0] + .values + .error_percentage / 100; + + JSErrorsGauge.setValues(Number(percentage.toFixed(8))); + resolve(); +} +//... + +``` +Please, see prometheus [base units](https://prometheus.io/docs/practices/naming/#base-units) before set value in chart. +After set value, promise is resolved. + +## **Tests** +We use [jest](https://jestjs.io/) to write and run tests. +In **most cases** you will need to write test scenarios for the code you are developing. + +Run tests using ``` jest``` or ```npm test``` command. To see coverage, run ```jest --coverage```. + + diff --git a/README.md b/README.md index fc3af32..1bb6fad 100644 --- a/README.md +++ b/README.md @@ -10,19 +10,19 @@ You will need [API_KEY](https://docs.newrelic.com/docs/apis/getting-started/intr ### **With docker:** To run: -``` +```cmd docker run -p 9595:9595 -e "API_KEY=****" -e "APP_ID=****" caninjas/newrelic_browser_exporter ``` ### **From source:** Clone this repo and go to newrelic_browser_exporter folder: -``` +```cmd > git clone git@github.com:ContaAzul/newrelic_browser_exporter.git > cd newrelic_browser_exporter ``` Install dependencies with ```npm install``` command and run with: -``` +```cmd npm start APP_ID='****' API_KEY='****' ``` diff --git a/src/plugins/newrelic_browser/javascriptErrorsPercent/javascriptErrorsPercent.js b/src/plugins/newrelic_browser/javascriptErrorsPercent/javascriptErrorsPercent.js index c410817..e9d2b85 100644 --- a/src/plugins/newrelic_browser/javascriptErrorsPercent/javascriptErrorsPercent.js +++ b/src/plugins/newrelic_browser/javascriptErrorsPercent/javascriptErrorsPercent.js @@ -24,6 +24,7 @@ const collectData = () => new Promise((resolve, reject) => { const names = 'EndUser/errors'; const values = 'error_percentage'; + browser .collectData(names, values) .then((response) => { From 12e5e37fe7e08876e1cf3caadfcb686bf54c2ff9 Mon Sep 17 00:00:00 2001 From: guilhermecarneiroo Date: Wed, 24 Oct 2018 15:26:14 -0200 Subject: [PATCH 03/11] =?UTF-8?q?=1B[200~Table=20of=20Contents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e5b8f44..f7b6cc5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,15 @@ # **How to contribute to newrelic browser exporter** +#### Table of Contents + +[Project structure](#project-structure) + * [application](#application) + * [plugins](#plugins) + +[How to set up a new metric](#How-to-set-up-new-metric) + +[Tests](#tests) + ## **Project structure** ### **application**: @@ -43,7 +53,7 @@ **prometheus/charts** - Contains the metric types used to create new chart. To know which metrics are supported by prometheus, see [metric types](https://prometheus.io/docs/concepts/metric_types/). -## **How to set up a new metric** +## **How to set up new metric** Create a folder inside newrelic_browser. This folder shold be a file with a public method and callback method. The public method(In javascriptErrorsPercent this method is called collectData) will be initialize the chart if is the first call, like this: From bf0228d23ecf4cb349f28956efb3c58f6df773d2 Mon Sep 17 00:00:00 2001 From: guilhermecarneiroo Date: Wed, 24 Oct 2018 15:41:59 -0200 Subject: [PATCH 04/11] add links --- CONTRIBUTING.md | 18 ++++++++---------- README.md | 3 +++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7b6cc5..883a8cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,13 +23,13 @@ └── index.js ``` -**src/app/routes/metrics.js** - Will be executed when the /metrics route is accessed. This code will start to collect data from newRelic plugin and output a string to [prometheus consuming](https://github.com/siimon/prom-client#register). +**[src/app/routes/metrics.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/routes/metrics.js)** - Will be executed when the /metrics route is accessed. This code will start to collect data from newRelic plugin and output a string to [prometheus consuming](https://github.com/siimon/prom-client#register). -**src/app/router.js** - Initialize /metrics route. +**[src/app/router.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/router.js)** - Initialize /metrics route. -**src/app/server.js** - Contains the code to start application and configure application routes. +**[src/app/server.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/server.js)** - Contains the code to start application and configure application routes. -**src/index.js** - Start server methods. +**[src/index.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/index.js)** - Start server methods. ### **plugins**: ``` @@ -44,13 +44,13 @@ └── gauge.js ``` -**newrelic_browser/** - Contains the code that will communicate with the API([api-request.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/plugins/newrelic_browser/api-request.js)) and the code that will initialize the prometheus chart and execute the callback after call to the API. +**[newrelic_browser/](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/newrelic_browser)** - Contains the code that will communicate with the API([api-request.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/plugins/newrelic_browser/api-request.js)) and the code that will initialize the prometheus chart and execute the callback after call to the API. -**newrelic_browser/javascriptErrorsPercent/** - Contains the code that will create the javascript errors percent chart according prometheus model and the code that will be executed after the api response and set this data in chart. +**[newrelic_browser/javascriptErrorsPercent/](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/newrelic_browser/javascriptErrorsPercent)** - Contains the code that will create the javascript errors percent chart according prometheus model and the code that will be executed after the api response and set this data in chart. -**newrelic_browser/api-requets** - Contains the code that will setup data before call newrelic api. API will return a unique value corresponding to the value of that data in the last minute. +**[newrelic_browser/api-requets](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/plugins/newrelic_browser/api-request.js)** - Contains the code that will setup data before call newrelic api. API will return a unique value corresponding to the value of that data in the last minute. -**prometheus/charts** - Contains the metric types used to create new chart. To know which metrics are supported by prometheus, see [metric types](https://prometheus.io/docs/concepts/metric_types/). +**[prometheus/charts](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/prometheus/charts)** - Contains the metric types used to create new chart. To know which metrics are supported by prometheus, see [metric types](https://prometheus.io/docs/concepts/metric_types/). ## **How to set up new metric** @@ -136,5 +136,3 @@ We use [jest](https://jestjs.io/) to write and run tests. In **most cases** you will need to write test scenarios for the code you are developing. Run tests using ``` jest``` or ```npm test``` command. To see coverage, run ```jest --coverage```. - - diff --git a/README.md b/README.md index 1bb6fad..b3beeda 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,6 @@ npm start APP_ID='****' API_KEY='****' ``` Metrics will be exposed in ```localhost:9595/metrics``` + +Would you like to help? See [contributing](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/CONTRIBUTING.md). + From 97a340833412678f3054877ec786c8cfb4837ea3 Mon Sep 17 00:00:00 2001 From: guilhermecarneiroo Date: Wed, 24 Oct 2018 15:49:59 -0200 Subject: [PATCH 05/11] add info --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 883a8cd..ae1aaee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,6 +98,8 @@ Code to call api: ```js //... +const browser = require('../api-request'); + const collectData = () => new Promise((resolve, reject) => { //... From b08bfca324efbdfdb5fd8d5ea354e44bbfd36d61 Mon Sep 17 00:00:00 2001 From: guilhermecarneiroo Date: Thu, 25 Oct 2018 15:05:07 -0200 Subject: [PATCH 06/11] cr --- CONTRIBUTING.md | 56 +++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae1aaee..66efe63 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,13 +23,13 @@ └── index.js ``` -**[src/app/routes/metrics.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/routes/metrics.js)** - Will be executed when the /metrics route is accessed. This code will start to collect data from newRelic plugin and output a string to [prometheus consuming](https://github.com/siimon/prom-client#register). +**[src/app/routes/metrics.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/routes/metrics.js)** - It represents the `/metrics` route, which outputs the metrics from `register.metrics()` as a string in a Prometheus like format that can be consumed by a [Prometheus Client](https://github.com/siimon/prom-client#register). -**[src/app/router.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/router.js)** - Initialize /metrics route. +**[src/app/router.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/router.js)** - It registers all applications routes. -**[src/app/server.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/server.js)** - Contains the code to start application and configure application routes. +**[src/app/server.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/server.js)** - Contains the code to start and configure the application. -**[src/index.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/index.js)** - Start server methods. +**[src/index.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/index.js)** - It starts the application. ### **plugins**: ``` @@ -44,20 +44,17 @@ └── gauge.js ``` -**[newrelic_browser/](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/newrelic_browser)** - Contains the code that will communicate with the API([api-request.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/plugins/newrelic_browser/api-request.js)) and the code that will initialize the prometheus chart and execute the callback after call to the API. +**[newrelic_browser/](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/newrelic_browser)** - This plugin is responsible for pulling data from New Relic's API([api-request.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/plugins/newrelic_browser/api-request.js)) and exporting it as Prometheus charts. -**[newrelic_browser/javascriptErrorsPercent/](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/newrelic_browser/javascriptErrorsPercent)** - Contains the code that will create the javascript errors percent chart according prometheus model and the code that will be executed after the api response and set this data in chart. +**[prometheus](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/prometheus)** - Contains the metric types used to create new Prometheus charts and exports the global Prometheus `registry`. To know which metrics are supported by prometheus, see [metric types](https://prometheus.io/docs/concepts/metric_types/). -**[newrelic_browser/api-requets](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/plugins/newrelic_browser/api-request.js)** - Contains the code that will setup data before call newrelic api. API will return a unique value corresponding to the value of that data in the last minute. -**[prometheus/charts](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/prometheus/charts)** - Contains the metric types used to create new chart. To know which metrics are supported by prometheus, see [metric types](https://prometheus.io/docs/concepts/metric_types/). +## **How to set up a new metric** - -## **How to set up new metric** - -Create a folder inside newrelic_browser. This folder shold be a file with a public method and callback method. The public method(In javascriptErrorsPercent this method is called collectData) will be initialize the chart if is the first call, like this: +Create a new folder inside `newrelic_browser` plugin. Inside this folder create a new file that must have a public method called `collectData` which must return a new `Promise`. The public method initializes and returns the chart: ```js +// javascriptErrorsPercent.js const GaugeChart = require('../../prometheus/charts/gauge'); let JSErrorsGauge; @@ -69,35 +66,34 @@ const collectData = () => new Promise((resolve, reject) => { }); } - //... (hidden code) + ... } module.exports = { collectData, }; ``` -Please read [prometheus best practices](https://prometheus.io/docs/practices/naming/) to name your chart configurations. -After create the chart configuration you will need to set up the name and the value to retrieve specific metrics from this data. +Please read [prometheus best practices](https://prometheus.io/docs/practices/naming/) to name your chart's configurations. + +After creating the chart's configuration it is necessary to set up the parameters such as `name` and `value` to retrieve specific metrics from this [New Relic's API](https://rpm.newrelic.com/api/explore/applications/metric_data) ```js -//... +// javascriptErrorsPercent.js const collectData = () => new Promise((resolve, reject) => { - //... + ... const names = 'EndUser/errors'; const values = 'error_percentage'; - //... + ... } -//... ``` -Now you can call newrelic api passing these arguments and the callback that will be executed after api response and will set the metric value. -Code to call api: +Now that all parameters are set up, a request to New Relic's API can be done by calling `browser.collectData()`: ```js -//... +// javascriptErrorsPercent.js const browser = require('../api-request'); const collectData = () => new Promise((resolve, reject) => { @@ -105,7 +101,7 @@ const collectData = () => new Promise((resolve, reject) => { browser .collectData(names, values) - .then((response) => { + .then(response => { onSuccess(response, resolve); }) .catch(reject); @@ -113,10 +109,11 @@ const collectData = () => new Promise((resolve, reject) => { } //... ``` -Callback method should set the metric collected from api request into chart(I this example, the chart is JSErrorsGauge): + +A callback method should set the metrics collected from New Relic's API into the chart. Please, see prometheus [base units](https://prometheus.io/docs/practices/naming/#base-units) to know how to set values into charts according Prometheus patterns. ```js -//... +// javascriptErrorsPercent.js function onSuccess(response, resolve) { const percentage = JSON.parse(response) .metric_data.metrics[0] @@ -130,11 +127,10 @@ function onSuccess(response, resolve) { //... ``` -Please, see prometheus [base units](https://prometheus.io/docs/practices/naming/#base-units) before set value in chart. -After set value, promise is resolved. + +After setting values to the chart and resolving the `Promise`, New Relic's metrics are avaliable as Prometheus metrics in the `/metrics` endpoint. ## **Tests** -We use [jest](https://jestjs.io/) to write and run tests. -In **most cases** you will need to write test scenarios for the code you are developing. +Tests are written using [jest](https://jestjs.io/). In **most cases** new test scenarios are necessary for the new developed code. -Run tests using ``` jest``` or ```npm test``` command. To see coverage, run ```jest --coverage```. +Run tests using `jest` or `npm test` commands. To see coverage, run `jest --coverage`. From c1598026bca00aabefde3c9d2dce0d9f6f6c5d75 Mon Sep 17 00:00:00 2001 From: guilhermecarneiroo Date: Thu, 25 Oct 2018 15:16:03 -0200 Subject: [PATCH 07/11] fix table of content link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66efe63..2802062 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ * [application](#application) * [plugins](#plugins) -[How to set up a new metric](#How-to-set-up-new-metric) +[How to set up a new metric](#How-to-set-up-a-new-metric) [Tests](#tests) From f99056ae6b30f1b90b09e319578d7c716eccb96c Mon Sep 17 00:00:00 2001 From: Ciro Ferreira da Cruz Date: Fri, 26 Oct 2018 10:43:26 -0300 Subject: [PATCH 08/11] Update CONTRIBUTING.md Co-Authored-By: guilhermecarneiroo --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2802062..ed5efe1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ **[src/app/routes/metrics.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/routes/metrics.js)** - It represents the `/metrics` route, which outputs the metrics from `register.metrics()` as a string in a Prometheus like format that can be consumed by a [Prometheus Client](https://github.com/siimon/prom-client#register). -**[src/app/router.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/router.js)** - It registers all applications routes. +**[src/app/router.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/router.js)** - It registers all application routes. **[src/app/server.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/app/server.js)** - Contains the code to start and configure the application. From 41c28560ebfdedc92460fadaa5880718064ece2b Mon Sep 17 00:00:00 2001 From: Ciro Ferreira da Cruz Date: Fri, 26 Oct 2018 10:43:39 -0300 Subject: [PATCH 09/11] Update CONTRIBUTING.md Co-Authored-By: guilhermecarneiroo --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed5efe1..3da0489 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,7 @@ **[newrelic_browser/](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/newrelic_browser)** - This plugin is responsible for pulling data from New Relic's API([api-request.js](https://github.com/ContaAzul/newrelic_browser_exporter/blob/master/src/plugins/newrelic_browser/api-request.js)) and exporting it as Prometheus charts. -**[prometheus](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/prometheus)** - Contains the metric types used to create new Prometheus charts and exports the global Prometheus `registry`. To know which metrics are supported by prometheus, see [metric types](https://prometheus.io/docs/concepts/metric_types/). +**[prometheus](https://github.com/ContaAzul/newrelic_browser_exporter/tree/master/src/plugins/prometheus)** - Contains the metric types used to create new Prometheus charts and exports the global Prometheus `registry`. To know which metrics are supported by Prometheus, see [metric types](https://prometheus.io/docs/concepts/metric_types/). ## **How to set up a new metric** From 0a1b73f55b50ccd6ccb5d9ebb19789c8cca2d599 Mon Sep 17 00:00:00 2001 From: Ciro Ferreira da Cruz Date: Fri, 26 Oct 2018 10:43:57 -0300 Subject: [PATCH 10/11] Update CONTRIBUTING.md Co-Authored-By: guilhermecarneiroo --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3da0489..a7ffcd2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,7 +76,7 @@ module.exports = { Please read [prometheus best practices](https://prometheus.io/docs/practices/naming/) to name your chart's configurations. -After creating the chart's configuration it is necessary to set up the parameters such as `name` and `value` to retrieve specific metrics from this [New Relic's API](https://rpm.newrelic.com/api/explore/applications/metric_data) +After configuring the chart, it is necessary to set up parameters such as `name` and `value` to retrieve specific metrics from [New Relic's API](https://rpm.newrelic.com/api/explore/applications/metric_data) ```js // javascriptErrorsPercent.js From 6ea960ec83907f915c78273fa3798222f3c43ea0 Mon Sep 17 00:00:00 2001 From: Ciro Ferreira da Cruz Date: Fri, 26 Oct 2018 10:44:22 -0300 Subject: [PATCH 11/11] Update CONTRIBUTING.md Co-Authored-By: guilhermecarneiroo --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7ffcd2..e9ae4fb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,7 +74,7 @@ module.exports = { }; ``` -Please read [prometheus best practices](https://prometheus.io/docs/practices/naming/) to name your chart's configurations. +Please take a look at [Prometheus best practices](https://prometheus.io/docs/practices/naming/) to learn how to set up a chart's configurations properly. After configuring the chart, it is necessary to set up parameters such as `name` and `value` to retrieve specific metrics from [New Relic's API](https://rpm.newrelic.com/api/explore/applications/metric_data)