This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@vrbo/service-client-statsd

3.3.1 • Public • Published

@vrbo/service-client-statsd

NPM Version Dependency Status NPM Downloads

A Service Client plugin for reporting operational metrics to a StatsD daemon.

Contents

Usage

const ServiceClient = require('@vrbo/service-client');
const SCStatsD = require('@vrbo/service-client-statsd');

ServiceClient.use(SCStatsD);

const client = ServiceClient.create('myservice')

(async function() {
    await client.request({ method: 'GET', path: '/v1/test/endpoint', operation: 'foobar' })
    /**
     * Outputs metrics to StatsD daemon:
     * localhost.serviceclient.myservice.foobar.statusCode200 method=increment
     * localhost.serviceclient.myservice.foobar.statusCode2xx method=increment
     * localhost.serviceclient.myservice.foobar.total method=timing value=1
     */
})()

See plugin documentation for more usage information.

Configuration Options

  • hostname - The hostname used to initialize the internal instance of Lynx. Defaults to 'localhost'.
  • port - The port used to initialize the internal instance of Lynx. Defaults to 8125.
  • tcp - Whether or not to transmit stats via TCP. Defaults to false.
  • lynxOptions - Additional configuration options used to initilize the internal instance of Lynx.
  • transmit - A boolean indicating whether or not to actually send these metrics to the Lynx instance. Defaults to true.
  • prefix - An optional value to prepend to the beginning of the metrics key reported to StatsD.

Example:

const client = ServiceClient.create('myservice', {
    plugins: {
        statsd: {
            // options here
        }
    }
})

Development

This package uses debug for logging debug statements.

Use the serviceclient:plugin:statsd namespace to log related information:

DEBUG=serviceclient:plugin:statsd npm test

Further Reading

Package Sidebar

Install

npm i @vrbo/service-client-statsd

Weekly Downloads

2

Version

3.3.1

License

Apache-2.0

Unpacked Size

30.1 kB

Total Files

11

Last publish

Collaborators

  • aarestrada
  • codeburke
  • expediagroup_oss
  • joonastanner
  • lasanthak
  • mcjfunk
  • notethis
  • shellbj
  • tlivings
  • tuckbick
  • yosafat-eg