How to use the inspector-influx.InfluxMetricReporter function in inspector-influx

To help you get started, we’ve selected a few inspector-influx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github destinygg / chat-bot / lib / services / metrics / influx-metrics-reporter.js View on Github external
sender.db.pool.text = function internal(props) {
      // eslint-disable-next-line no-param-reassign
      props.path = config.pathPrefix + props.path;
      // eslint-disable-next-line prefer-rest-params
      return oldText.apply(this, arguments);
    };

    sender.db.pool.discard = function internal(props) {
      // eslint-disable-next-line no-param-reassign
      props.path = config.pathPrefix + props.path;
      // eslint-disable-next-line prefer-rest-params
      return oldDiscard.apply(this, arguments);
    };

    this.reporter = new InfluxMetricReporter({
      sender,
      tags,
      unit: MILLISECOND,
      reportInterval: 30000,
    });

    this.reporter.setLog({
      info: () => {},
      trace: () => {},
      debug: () => {},
      warn: () => {},
      error: () => {},
    });

    this.metrics = {};
    this.registry = new MetricRegistry();
github rstiller / inspector-metrics / examples / express4-multi-process-js / src / metrics.js View on Github external
async function influxReporter (registry, tags) {
  const {
    DefaultSender,
    InfluxMetricReporter
  } = require('inspector-influx')

  const sender = new DefaultSender({
    database: 'express4',
    hosts: [{
      host: '127.0.0.1',
      port: 8086
    }]
  })
  const reporter = new InfluxMetricReporter({
    log: null,
    minReportingTimeout: 30,
    reportInterval: 5000,
    sender
  })

  reporter.setTags(tags)
  reporter.addMetricRegistry(registry)

  await reporter.start()

  return reporter
}

inspector-influx

InfluxDB metric reporter for nodejs

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis