Registry / database / opentelemetry-instrumentation-eqxjs-ioredis

opentelemetry-instrumentation-eqxjs-ioredis

JSON →
library0.49.10jsnpmunverified

OpenTelemetry automatic instrumentation for the ioredis Redis client library (Node.js). Current stable version is 0.49.10, released as part of the OpenTelemetry JS Contrib repository. This package provides tracing for ioredis operations, including database statements, command arguments, and custom hooks for adding attributes. It supports ioredis versions >=2.0.0 <6 and requires @opentelemetry/api ^1.3.0. Compared to manual instrumentation, it offers automatic span creation and configuration options like db statement serialization and request/response hooks. It is included in the @opentelemetry/auto-instrumentations-node bundle.

npm install opentelemetry-instrumentation-eqxjs-ioredis
INSTALL
IMPORT
SIG · OPENTELEMETRY-INST
O
opentelemetry-instrumentation-eqxjs-ioredis
databasejavascriptv0.49.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IORedisInstrumentation
const { IORedisInstrumentation } = require('@opentelemetry/instrumentation-ioredis');
const IORedisInstrumentation = require('@opentelemetry/instrumentation-ioredis');
CommonJS named import. Not a default export.
IORedisInstrumentation
import { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';
import IORedisInstrumentation from '@opentelemetry/instrumentation-ioredis';
ESM named import. The package does not have a default export.
registerInstrumentations
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { registerInstrumentations } = require('@opentelemetry/instrumentation-ioredis');
registerInstrumentations is from the base @opentelemetry/instrumentation package, not this one.

Initializes OpenTelemetry with ioredis instrumentation that serializes only command names, then performs a basic set/get.

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); const { IORedisInstrumentation } = require('@opentelemetry/instrumentation-ioredis'); const { registerInstrumentations } = require('@opentelemetry/instrumentation'); const provider = new NodeTracerProvider(); provider.register(); registerInstrumentations({ instrumentations: [ new IORedisInstrumentation({ dbStatementSerializer: function (cmdName, cmdArgs) { return cmdName; }, }), ], }); const Redis = require('ioredis'); const redis = new Redis({ host: process.env.REDIS_HOST ?? 'localhost' }); redis.set('key', 'value').then(() => redis.get('key')).then(console.log);
Debug
Known issues
breakingIn previous versions, the instrumentation was named @opentelemetry/instrumentation-ioredis but the package name changed to include 'eqxjs' in some experimental releases; ensure you use the correct package name for your version.
fix
Use @opentelemetry/instrumentation-ioredis (without eqxjs) for stable releases.
affects: >=0.40.0 <0.49.0
deprecatedThe `requireParentSpan` option default is true, which may cause missing spans if no parent span exists.
fix
Set `requireParentSpan: false` if you want spans without an active parent.
affects: >=0.30.0
gotchaThe `dbStatementSerializer` function receives `cmdArgs` which may contain sensitive data; ensure your serializer strips or masks values to avoid leaking secrets.
fix
Implement a custom serializer that returns only non-sensitive parts.
affects: >=0.0.0
breakingSupport for ioredis versions <2.0.0 was dropped in v0.30.0.
fix
Upgrade ioredis to >=2.0.0.
affects: >=0.30.0
gotchaThe instrumentation requires @opentelemetry/api@^1.3.0; mixing versions (e.g., using @opentelemetry/api 1.0.0) will cause runtime errors.
fix
Ensure @opentelemetry/api version matches the peer dependency.
affects: >=0.30.0
Errors
Common errors & fixes
Cannot find module '@opentelemetry/instrumentation-ioredis'
Package not installed or typo in package name.
fix
Run `npm install @opentelemetry/instrumentation-ioredis`
TypeError: IORedisInstrumentation is not a constructor
Incorrect import: using default import instead of named import.
fix
Use `const { IORedisInstrumentation } = require('...');`
Uncaught Error: Cannot find module '@opentelemetry/api'
Missing peer dependency @opentelemetry/api.
fix
Install @opentelemetry/api: `npm install @opentelemetry/api`
Upgrade
Version history
0.49.10latest on npm
Audit
Dependencies
@opentelemetry/apirequiredPeer dependency required for OpenTelemetry API
Agent activity
13 hits · last 30 days
node
10
Amazon
2
Resources
opentelemetry-instrumentation-eqxjs-ioredis — npm install opentelemetry-instrumentation-eqxjs-ioredis · libregistry