{"id":41678,"library":"opentelemetry-instrumentation-eqxjs-ioredis","title":"OpenTelemetry ioredis Instrumentation","description":"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.","status":"active","version":"0.49.10","language":"javascript","source_language":"en","source_url":"https://github.com/open-telemetry/opentelemetry-js-contrib","tags":["javascript","instrumentation","ioredis","nodejs","opentelemetry","profiling","redis","tracing","typescript"],"install":[{"cmd":"npm install opentelemetry-instrumentation-eqxjs-ioredis","lang":"bash","label":"npm"},{"cmd":"yarn add opentelemetry-instrumentation-eqxjs-ioredis","lang":"bash","label":"yarn"},{"cmd":"pnpm add opentelemetry-instrumentation-eqxjs-ioredis","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for OpenTelemetry API","package":"@opentelemetry/api","optional":false}],"imports":[{"note":"CommonJS named import. Not a default export.","wrong":"const IORedisInstrumentation = require('@opentelemetry/instrumentation-ioredis');","symbol":"IORedisInstrumentation","correct":"const { IORedisInstrumentation } = require('@opentelemetry/instrumentation-ioredis');"},{"note":"ESM named import. The package does not have a default export.","wrong":"import IORedisInstrumentation from '@opentelemetry/instrumentation-ioredis';","symbol":"IORedisInstrumentation","correct":"import { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';"},{"note":"registerInstrumentations is from the base @opentelemetry/instrumentation package, not this one.","wrong":"const { registerInstrumentations } = require('@opentelemetry/instrumentation-ioredis');","symbol":"registerInstrumentations","correct":"const { registerInstrumentations } = require('@opentelemetry/instrumentation');"}],"quickstart":{"code":"const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');\nconst { IORedisInstrumentation } = require('@opentelemetry/instrumentation-ioredis');\nconst { registerInstrumentations } = require('@opentelemetry/instrumentation');\n\nconst provider = new NodeTracerProvider();\nprovider.register();\n\nregisterInstrumentations({\n  instrumentations: [\n    new IORedisInstrumentation({\n      dbStatementSerializer: function (cmdName, cmdArgs) {\n        return cmdName;\n      },\n    }),\n  ],\n});\n\nconst Redis = require('ioredis');\nconst redis = new Redis({ host: process.env.REDIS_HOST ?? 'localhost' });\nredis.set('key', 'value').then(() => redis.get('key')).then(console.log);","lang":"javascript","description":"Initializes OpenTelemetry with ioredis instrumentation that serializes only command names, then performs a basic set/get."},"warnings":[{"fix":"Use @opentelemetry/instrumentation-ioredis (without eqxjs) for stable releases.","message":"In 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.","severity":"breaking","affected_versions":">=0.40.0 <0.49.0"},{"fix":"Set `requireParentSpan: false` if you want spans without an active parent.","message":"The `requireParentSpan` option default is true, which may cause missing spans if no parent span exists.","severity":"deprecated","affected_versions":">=0.30.0"},{"fix":"Implement a custom serializer that returns only non-sensitive parts.","message":"The `dbStatementSerializer` function receives `cmdArgs` which may contain sensitive data; ensure your serializer strips or masks values to avoid leaking secrets.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade ioredis to >=2.0.0.","message":"Support for ioredis versions <2.0.0 was dropped in v0.30.0.","severity":"breaking","affected_versions":">=0.30.0"},{"fix":"Ensure @opentelemetry/api version matches the peer dependency.","message":"The instrumentation requires @opentelemetry/api@^1.3.0; mixing versions (e.g., using @opentelemetry/api 1.0.0) will cause runtime errors.","severity":"gotcha","affected_versions":">=0.30.0"}],"env_vars":null,"search_vec":"'0.49.10':18 '1.3.0':55 '2.0.0':50 '6':51 'ad':44 'argument':39 'attribut':45 'automat':5,62 'bundl':81 'client':11 'command':38 'compar':56 'configur':66 'contrib':26 'creation':64 'current':14 'custom':41 'databas':36 'db':69 'hook':42,74 'includ':35,77 'instrument':3,6,59,83 'ioredi':2,9,33,48,84 'javascript':82 'js':25 'librari':12 'like':68 'manual':58 'node.js':13 'nodej':85 'offer':61 'opentelemetri':1,4,24,86 'opentelemetry/api':54 'opentelemetry/auto-instrumentations-node':80 'oper':34 'option':67 'packag':29 'part':21 'profil':87 'provid':30 'redi':10,88 'releas':19 'repositori':27 'request/response':73 'requir':53 'serial':71 'span':63 'stabl':15 'statement':37,70 'support':47 'trace':31,89 'typescript':90 'version':16,49","created_at":"2026-06-04T18:53:34.898010+00:00","updated_at":"2026-06-04T18:53:34.898010+00:00","problems":[{"fix":"Run `npm install @opentelemetry/instrumentation-ioredis`","cause":"Package not installed or typo in package name.","error":"Cannot find module '@opentelemetry/instrumentation-ioredis'"},{"fix":"Use `const { IORedisInstrumentation } = require('...');`","cause":"Incorrect import: using default import instead of named import.","error":"TypeError: IORedisInstrumentation is not a constructor"},{"fix":"Install @opentelemetry/api: `npm install @opentelemetry/api`","cause":"Missing peer dependency @opentelemetry/api.","error":"Uncaught Error: Cannot find module '@opentelemetry/api'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-ioredis#readme","github":"https://github.com/open-telemetry/opentelemetry-js-contrib","docs":null,"changelog":null,"pypi":null,"npm":"opentelemetry-instrumentation-eqxjs-ioredis","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}