3.3.1 • Published 10 months ago

@vrbo/service-client-statsd v3.3.1

Weekly downloads
16
License
Apache-2.0
Repository
github
Last release
10 months ago

@vrbo/service-client-statsd

NPM Version npm.io 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

3.3.1

10 months ago

3.2.2

1 year ago

3.3.0

1 year ago

3.2.1

1 year ago

3.2.0

1 year ago

3.1.0

1 year ago

3.0.1

2 years ago

3.0.0

2 years ago

2.1.0

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago