0.2.1 • Published 5 years ago
@telemetry-js/processor-ec2-instance-tags v0.2.1
processor-ec2-instance-tags
Copy tags of EC2 instance to metrics.
Atelemetryplugin.
Table of Contents
Usage
const telemetry = require('@telemetry-js/telemetry')()
const tags = require('@telemetry-js/processor-ec2-instance-tags')
telemetry.task()
.process(tags)
// Or with options
telemetry.task()
.process(tags, { include: ['name', 'version'] })Options
case: optional function to normalize a tag. E.g.(key) => key.toLowerCase(). The default behavior is to lowercase the key and strip any characters outside of[a-z0-9]. If the EC2 instance has aProjecttag for example, metrics will be tagged withproject.include: optional array of tags to include, normalized. E.g.['project']. By default all tags are included.filter: optional function to filter tags. E.g.(key) => key === 'project'. Takes precedence overoptions.include.
Cached variant
By default, each instance of this plugin fetches EC2 instance metadata and tags itself. To only fetch once (with a semiglobal cache) use:
const tags = require('@telemetry-js/processor-ec2-instance-tags').cachedInstall
With npm do:
npm install @telemetry-js/processor-ec2-instance-tagsAcknowledgements
This project is kindly sponsored by Reason Cybersecurity Ltd.
License
MIT © Vincent Weevers
0.2.1
5 years ago
