Skip to content

telemetry-js/collector-redis

Repository files navigation

collector-redis

Collect Redis 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 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.

Options

  • connection: required, object in the form of { host, port, password }
  • tags: optional, object. Note that some metrics (database.*, command.*) have their own tags (db and command, 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.

Install

With npm do:

npm install @telemetry-js/collector-redis

Acknowledgements

This project is kindly sponsored by Reason Cybersecurity Ltd.

reason logo

License

MIT © Vincent Weevers