Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

logzio-nodejs-metrics

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logzio-nodejs-metrics

A nodejs implementation for sending metrics to Logz.io

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-13.21%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

logzio-nodejs-metrics

NodeJS metrics shipper for Logz.io. Based on the logzio-nodejs logger, it will send metrics to your Logz.io metrics account.

Sample usage

var metricsShipper = require('logzio-nodejs-metrics').createMetrics({
    token: '__YOUR_API_TOKEN__',
});


// sending metrics with send(metrics, dimensions)
metricsShipper.send(
  { cpu: 0.2, memory: 200 },
  { host: 'my-host', env: 'PROD' },
);

Note: If logzio-js is used as part of a serverless service (AWS Lambda, Azure Functions, Google Cloud Functions, etc.), add logger.sendAndClose() at the end of the run.

Options

  • token Mandatory. Your API logging token. Look it up in the Device Config tab in Logz.io
  • type - Log type. Help classify logs into different classifications
  • protocol - http, https or udp. Default: http
  • host - Destination host name. Default: listener.logz.io
  • port - Destination port. Default port depends on protocol. http is 8070 and 8071 is for https
  • sendIntervalMs - Time in milliseconds to wait between retry attempts. Default: 2000 (2 sec)
  • bufferSize - The maximum number of messages the logger will accumulate before sending them all as a bulk. Default: 100.
  • numberOfRetries - The maximum number of retry attempts. Default: 3
  • debug - Should the logger print debug messages to the console? Default: false
  • callback - A callback function called when an unrecoverable error has occured in the logger. The function API is: function(err) - err being the Error object.
  • timeout - The read/write/connection timeout in milliseconds.
  • addTimestampWithNanoSecs - Add a timestamp with nano seconds granularity. This is needed when many logs are sent in the same millisecond, so you can properly order the logs in kibana. The added timestamp field will be @timestamp_nano Default: false
  • compress - If true the the logs are compressed in gzip format. Default: false
  • internalLogger - set internal logger that supports the function log. Default: console.

Update log

1.0.0

Scripts

  • run npm install to install required dependencies
  • run npm test to run unit tests

Keywords

FAQs

Package last updated on 09 Jul 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc