Socket
Book a DemoInstallSign in
Socket

@vrbo/service-client-statsd

Package Overview
Dependencies
Maintainers
11
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vrbo/service-client-statsd

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

latest
Source
npmnpm
Version
3.3.1
Version published
Weekly downloads
0
Maintainers
11
Weekly downloads
 
Created
Source

@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

Keywords

http

FAQs

Package last updated on 07 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts