Registry /
database / opentelemetry-instrumentation-eqxjs-ioredis
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.fixUse @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.fixSet `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.fixImplement 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.fixUpgrade 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.fixEnsure @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.
fixRun `npm install @opentelemetry/instrumentation-ioredis`
TypeError: IORedisInstrumentation is not a constructor
Incorrect import: using default import instead of named import.
fixUse `const { IORedisInstrumentation } = require('...');` Uncaught Error: Cannot find module '@opentelemetry/api'
Missing peer dependency @opentelemetry/api.
fixInstall @opentelemetry/api: `npm install @opentelemetry/api`
Audit
Dependencies
@opentelemetry/apirequiredPeer dependency required for OpenTelemetry API