nodejs-exporter-client

nodejs-exporter client.

Usage no npm install needed!

<script type="module">
  import nodejsExporterClient from 'https://cdn.skypack.dev/nodejs-exporter-client';
</script>

README

nodejs-exporter-client


Install

npm i nodejs-exporter-client

Example

const reporter = require('nodejs-exporter-client')

const reporter1 = new reporter('http://localhost:9091/pushGateway')

async function test () {
  let exampleData = {
    'host': 'host01',
    'serviceName': 'phm-app-server',
    'type': 'reqCounter',
    'data': {
      'path': '/api1',
      'method': 'GET',
      'code': '200'
    }
  }

  let res = await reporter1.push(exampleData)
  console.log(res)

  let res2 = await reporter1.push(JSON.stringify(exampleData))
  console.log(res2)
}