This plugin automatically instruments the ioredis module.

interface ioredis {
    allowlist?: string | RegExp | ((command) => boolean) | (string | RegExp | ((command) => boolean))[];
    blocklist?: string | RegExp | ((command) => boolean) | (string | RegExp | ((command) => boolean))[];
    enabled?: boolean;
    measured?: boolean | {
        [key: string]: boolean;
    };
    service?: any;
    splitByInstance?: boolean;
}

Hierarchy

  • Instrumentation
    • ioredis

Properties

allowlist?: string | RegExp | ((command) => boolean) | (string | RegExp | ((command) => boolean))[]

List of commands that should be instrumented. Commands must be in lowercase for example 'xread'.

Type declaration

    • (command): boolean
    • Parameters

      • command: string

      Returns boolean

Default

/^.*$/
blocklist?: string | RegExp | ((command) => boolean) | (string | RegExp | ((command) => boolean))[]

List of commands that should not be instrumented. Takes precedence over allowlist if a command matches an entry in both. Commands must be in lowercase for example 'xread'.

Type declaration

    • (command): boolean
    • Parameters

      • command: string

      Returns boolean

Default

[]
enabled?: boolean

Whether to enable the plugin.

Default

true
measured?: boolean | {
    [key: string]: boolean;
}

Whether to measure the span. Can also be set to a key-value pair with span names as keys and booleans as values for more granular control.

Type declaration

  • [key: string]: boolean
service?: any

The service name to be used for this plugin.

splitByInstance?: boolean

Whether to use a different service name for each Redis instance based on the configured connection name of the client.

Default

false