Collect Redis metrics.
Atelemetry
plugin.
Click to expand
const telemetry = require('@telemetry-js/telemetry')()
const redis = require('@telemetry-js/collector-redis')
telemetry.task()
.collect(redis, {
connection: {
host: 'example.com',
port: 6379,
password: 'abc'
},
tags: {
name: 'myapp-production'
}
})
To collect metrics from multiple Redis hosts, repeat the .collect
call. By default, all metrics will be tagged with host
to differentiate hosts. It is recommended that you add more meaningful tags (like name
) through the tags
option.
connection
: required, object in the form of{ host, port, password }
tags
: optional, object. Note that some metrics (database.*
,command.*
) have their own tags (db
andcommand
, respectively), taking precedence over your tags.metrics
: optional array of metric names to include. Supports wildcards, e.g.{ metrics: ['telemetry.redis.command.*']'
. By default, all metrics are included.
With npm do:
npm install @telemetry-js/collector-redis
This project is kindly sponsored by Reason Cybersecurity Ltd.
MIT © Vincent Weevers