Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@vrbo/service-client-statsd

expediagroup13Apache-2.0deprecated3.3.1

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

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

http, statsd, metrics, service-client, service, homeaway, vrbo, expedia, expediagroup

readme

@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

changelog

3.3.1 (2023-07-07)

Bug Fixes

  • replaced eslint-plugin-node with eslint-plugin-n (#110) (4056c15)

3.3.0 (2023-02-21)

Features

3.2.2 (2023-02-16)

Bug Fixes

  • Altering the order of semantic release config file to have it correct (#70) (c1d8171)

3.2.1 (2023-01-09)

Bug Fixes

  • build(deps): bump json5 from 1.0.1 to 1.0.2 (#52) (8e27cd0)

3.2.0 (2022-12-07)

Features

3.1.0 (2022-12-06)

Features

  • empty commit to trigger release pipeline (#50) (27cc16e)

3.0.1 (2022-01-07)

Bug Fixes

  • semantic-release: add semantic release (#46) (c04279b)

3.0.0 - 2021-11-04

  • [Breaking] Drop support for node < 14.
  • Update Github test workflow to only test node v 14.x
  • Update dependencies, npm, and engines in package.json to support node version >= 14.

2.1.0 - 2020-11-13

  • Add support for transmitting stats via TCP

2.0.1 - 2020-08-19

  • Update dev dependencies
  • Replace uses of @hapi/joi with joi (#31)

2.0.0 - 2020-08-10

  • [Breaking] Drop support for node < 12.
  • Update Github test workflow to only test node v 12.x
  • Update dependencies, npm, and engines in package.json to support node version >= 12.