New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@telemetry-js/plugin-debug

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@telemetry-js/plugin-debug

Log metrics and task lifecycle events with debug(), as a processor or publisher

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

plugin-debug

Log metrics and task lifecycle events with debug, as a processor or publisher.
A telemetry plugin.

npm status node Test JavaScript Style Guide

Table of Contents

Click to expand

Usage

const telemetry = require('@telemetry-js/telemetry')()
const debug = require('@telemetry-js/plugin-debug')

telemetry.task()
  .process(debug)

  // And/or
  .publish(debug)

This plugin can fulfill both the role of processor and publisher. In addition, it can be inserted into a task multiple times, e.g. before and after a certain processor. If you do, set a custom debug scope to differentiate the output.

For example, we can log metrics before they are summarized and when they are published:

const telemetry = require('@telemetry-js/telemetry')()
const osmem = require('@telemetry-js/collector-osmem')
const simple = require('@telemetry-js/schedule-simple')
const summarize = require('@telemetry-js/processor-summarize')
const debug = require('@telemetry-js/plugin-debug')

telemetry.task()
  .collect(osmem)
  .schedule(simple, { interval: '5s' })
  .process(debug, { scope: 'telemetry:process'})
  .process(summarize, { window: '1m' })
  .publish(debug, { scope: 'telemetry:publish'})

Debug output can be enabled with the environment variable DEBUG=telemetry:* Please see debug for details.

Options

Yet to document.

Install

With npm do:

npm install @telemetry-js/plugin-debug

Acknowledgements

This project is kindly sponsored by Reason Cybersecurity Ltd.

reason logo

License

MIT © Vincent Weevers

Keywords

metrics

FAQs

Package last updated on 09 Dec 2020

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