diff --git a/README.md b/README.md index 57b5464..dd1576c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +## Logz.io nodejs metrics sdk This topic includes instructions on how to send custom metrics to Logz.io from your Node.js application. The included example uses the [OpenTelemetry JS SDK](https://github.com/open-telemetry/opentelemetry-js) and its based on [OpenTelemetry exporter collector proto](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-collector-proto). @@ -5,8 +6,17 @@ The included example uses the [OpenTelemetry JS SDK](https://github.com/open-tel **Before you begin, you'll need**: Node 8 or higher + +**Note** This project works best with logzio as metrics backend, but its compatible with all backends that support `prometheuesrmotewrite` format + ## Quick start +Install the package: + +``` +npm install logzio-nodejs-metrics-sdk@0.0.1 +``` + Set the variables in the following code snippet: |Environment variable|Description| @@ -15,11 +25,13 @@ Set the variables in the following code snippet: |token| Your Logz.io Prometheus Metrics account token. | ```js const { MeterProvider } = require('@opentelemetry/metrics'); -const { RemoteWriteMetricExporter } = require('yotam-js-metrics-test'); +const { RemoteWriteMetricExporter } = require('logzio-nodejs-metrics-sdk'); const collectorOptions = { url: '<>', - token: '<>', + headers: { + "Authorization":"Bearer <>" + } }; // Initialize the exporter const metricExporter = new RemoteWriteMetricExporter(collectorOptions); @@ -58,11 +70,13 @@ For more information, see the OpenTelemetry [documentation](https://github.com/o First Initialize the exporter and meter provider: ```js const { MeterProvider } = require('@opentelemetry/metrics'); -const { RemoteWriteMetricExporter } = require('yotam-js-metrics-test'); +const { RemoteWriteMetricExporter } = require('logzio-nodejs-metrics-sdk'); const collectorOptions = { url: '<>', - token: '<>', + headers: { + "Authorization":"Bearer <>" + } }; // Initialize the exporter const metricExporter = new RemoteWriteMetricExporter(collectorOptions); diff --git a/package.json b/package.json index 0755ab1..e099b6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "logzio-nodejs-metrics-alpha", - "version": "0.0.2", + "name": "logzio-nodejs-metrics-sdk", + "version": "0.0.1", "description": "Logz.io node.js metrics Exporter allows user to send collected metrics to the Logz.io using OpenTelemetry SDK ", "main": "src/index.js", "repository": "logzio/js-metrics",