JSPM

@telemetry-js/plugin-debug

0.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q31801F
  • License MIT

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

Package Exports

  • @telemetry-js/plugin-debug

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@telemetry-js/plugin-debug) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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