JSPM

@telemetry-js/processor-summarize

0.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q33090F
  • License MIT

Locally summarize metrics within a time window

Package Exports

  • @telemetry-js/processor-summarize

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/processor-summarize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

processor-summarize

Locally summarize metrics within a time window, to account for spikes and valleys in that window without increasing traffic cost of published metrics.
A telemetry plugin.

npm status node Test JavaScript Style Guide

Table of Contents

Click to expand

Usage

const telemetry = require('@telemetry-js/telemetry')()
const summarize = require('@telemetry-js/processor-summarize')

telemetry.task()
  .process(summarize, { window: '5m' })

This will group metrics flowing through the task by metric name and distinct tag set, and emit a summary metric for each every 5 minutes, inheriting name, unit, statistic and tags.

To ensure that asynchronously collected or processed metrics fall within the window, processor-summarize operates on the task's schedule too, rather than having its own timer. The window option should be a multiple of the interval of a task's schedule, so that collected metrics fall within a predictable window. For example, if the interval is 60 seconds, the window can be 300 seconds, but not 90 seconds.

API

Options

  • window: required, number (milliseconds) or string (e.g. 5m, 60s)
  • suffix: optional, boolean. If true, appends .summary to metric names. For testing purposes only, e.g. to publish both a raw and summarized metric for comparison.

Install

With npm do:

npm install @telemetry-js/processor-summarize

Acknowledgements

This project is kindly sponsored by Reason Cybersecurity Ltd.

reason logo

License

MIT © Vincent Weevers