How to use the hot-shots function in hot-shots

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

github algolia / npm-search / src / datadog.js View on Github external
import StatsD from 'hot-shots';
import log from './log.js';

const env = process.env.NODE_ENV === 'production' ? 'prod' : 'dev';

const client = new StatsD({
  host: process.env.DOGSTATSD_HOST || 'localhost',
  port: 8125,
  prefix: 'alg.npmsearch.',
  globalTags: {
    env,
  },
  errorHandler(error) {
    log.error('[DATADOG ERROR]', error);
  },
});

export default client;
github artsy / metaphysics / src / lib / stats.js View on Github external
"http-outbound",
    "mongo",
    "socketio",
    "mqlight",
    "postgresql",
    "mqtt",
    "mysql",
    "redis",
    "riak",
    "memcached",
    "oracledb",
    "oracle",
    "strong-oracle",
  ]

  const statsClient = new StatsD({
    host: STATSD_HOST,
    port: STATSD_PORT,
    globalTags: { service: DD_TRACER_SERVICE_NAME, pod_name: os.hostname() },
    mock: !isProd,
    errorHandler: function(err) {
      error(`Statsd client error ${err}`)
    },
  })

  if (enableMetrics && isProd) {
    const appmetrics = require("appmetrics")
    appmetrics.configure({
      mqtt: "off",
    })
    const monitoring = appmetrics.monitor()
    _.forEach(appMetricsDisable, (val, idx) => {

hot-shots

Node.js client for StatsD, DogStatsD, and Telegraf

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis

Similar packages