{"id":19232620,"url":"https://github.com/makeomatic/opentracing-js-ioredis","last_synced_at":"2025-07-20T15:02:33.774Z","repository":{"id":57315575,"uuid":"95270584","full_name":"makeomatic/opentracing-js-ioredis","owner":"makeomatic","description":"Opentracing instrumentation for ioredis","archived":false,"fork":false,"pushed_at":"2018-12-19T22:52:46.000Z","size":117,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-04T09:45:57.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makeomatic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-24T02:28:23.000Z","updated_at":"2018-12-19T22:52:38.000Z","dependencies_parsed_at":"2022-09-18T20:52:20.317Z","dependency_job_id":null,"html_url":"https://github.com/makeomatic/opentracing-js-ioredis","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/makeomatic/opentracing-js-ioredis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Fopentracing-js-ioredis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Fopentracing-js-ioredis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Fopentracing-js-ioredis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Fopentracing-js-ioredis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makeomatic","download_url":"https://codeload.github.com/makeomatic/opentracing-js-ioredis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makeomatic%2Fopentracing-js-ioredis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266143942,"owners_count":23883069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T16:06:56.540Z","updated_at":"2025-07-20T15:02:33.706Z","avatar_url":"https://github.com/makeomatic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Opentracing Redis Node.js Instrumentation\n\nImplements opentracing Redis instrumentation for `ioredis` node.js client library\n\n## Install\n\n`yarn add opentracing-js-ioredis`\n\n## Usage\n\n### API\n\n#### applyInstrumentation(tracer: opentracer.Tracer, redis: Redis, [opts = {}])\n\nApplies instrumentation to Redis client instance, adding methods for seamlessly tracking calls to database\n\n```js\nconst Redis = require('ioredis');\nconst opentracing = require('opentracing');\nconst applyInstrumentation = require('opentracing-js-ioredis');\n\nconst tracer = opentracing.Tracer();\nconst redis = new Redis();\nconst opts = {\n  remoteServiceName: 'redis-production', // defaults to redis\n  name: 'traced', // default to `traced`, name of the function that will be attached to `redis`\n  tags: {\n    [opentracing.Tags.COMPONENT]: 'database', // extra tags that will be attached to spans all the time\n  },\n  // commands that won't create traces during `.traced` call, listed are defaults.\n  // You can only add commands, not remove them. Pipeline command itself is traced, but needs to be blacklisted\n  // as it is a special case\n  restrictedCommands: [\n    'ping',\n    'flushall',\n    'flushdb',\n    'select',\n    'auth',\n    'info',\n    'quit',\n    'slaveof',\n    'config',\n    'sentinel',\n    'cluster',\n    'swapdb',\n    'monitor',\n    'pipeline',\n  ],\n};\n\n// now redis is populated with `.traced` command\napplyInstrumentation(tracer, redis, opts);\n```\n\n##### redis.traced(context: ?Span, commandName: string, ...args: Array\u003cany\u003e): Promise\u003cany\u003e | Void\n\nInvokes `commandName` and passes `args` to it, creating a span with `commandName` and finishing it automatically\nParent context is passed via `context` arg and can be omitted. Make sure you call `.finish()` whenever it's time to\n\n#### applyInstrumentation.traceStatements(enabled: boolean)\n\nMay be useful for debugging purposes, enables setting tag of `opentracing.Tag.DB_STATEMENT` to serialized redis command.\nThis is a serious performance hit and is disabled by default as we call `command.toWritable` twice in that case\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakeomatic%2Fopentracing-js-ioredis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakeomatic%2Fopentracing-js-ioredis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakeomatic%2Fopentracing-js-ioredis/lists"}