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.
Atelemetryplugin.
Table of Contents
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.summaryto 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-summarizeAcknowledgements
This project is kindly sponsored by Reason Cybersecurity Ltd.
License
MIT © Vincent Weevers
