Documentation navigation

ioredis (OpenTelemetry)

The AppSignal for Node.js integration with OpenTelemetry for ioredis, through the ioredis package.

Installation

First follow the OpenTelemetry installation instructions.

In the tracing.js file, add the OpenTelemetry IORedisInstrumentation to the list of instrumentations.

By default the ioredis instrumentation includes full queries in the event data sent to AppSignal, which may include Personal Identifiable Information (PII) and sensitive data. For this reason we recommend using the IORedisDbStatementSerializer to sanitize queries.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// tracing.js
// The start of the tracing.js file, see the installation instructions

// Add the IORedisDbStatementSerializer import
const { IORedisDbStatementSerializer } = require('@appsignal/nodejs');
// Add the IORedisInstrumentation import
const { IORedisInstrumentation } = require('@opentelemetry/instrumentation-ioredis');

const sdk = new opentelemetry.NodeSDK({
  instrumentations: [
    // Other instrumention here

    // Add the IORedisInstrumentation
    new IORedisInstrumentation({
      requireParentSpan: false,
      dbStatementSerializer: IORedisDbStatementSerializer
    })
  ]
});

// The rest of the tracing.js file, see the installation instructions

Warning: By configuring a dbStatementSerializer that does not sanitize Redis queries the app may send Personal Identifiable Information (PII) and other sensitive data to AppSignal. We recommend you do not send any unsanitized queries.

We'd like to set cookies, read why.