Skip to content

a plan for redis instrumentation #2867

@trentm

Description

@trentm

Currently we have:

  • @opentelemetry/instrumentation-redis which instruments redis@2 (last release 2017-08-08) and redis@3 (last release 2021-04-20), and
  • @opentelemetry/instrumentation-redis-4 which instruments redis@4 (active)
  • nothing instruments redis@5 (first release 2025-04-30)

Proposal

tl;dr: We move to one @opentelemetry/instrumentation-redis that instruments redis@4 and redis@5. We drop support for instrumenting older versions of redis.

Details for the legacy package:

  • "plugins/node/opentelemetry-instrumentation-redis" is moved to "archive/instrumentation-redis-legacy/"
  • We open an issue specifically about the instrumentation support for redis@2 and redis@3 no longer getting releases. This remains open for a period of time (3 months? 6 months?) where users can give feedback on whether they still use/need this instrumentation -- indicating if they are willing to be or find a maintainer/code-owner for the instrumentation.
  • At the end of that period, OTel JS maintainers decide if there is a need to revive the instrumentation. If so, it returns as plugins/node/instrumentation-redis-legacy with the package name @opentelemetry/instrumentation-redis-legacy. If not, the "archive/..." code is replaced with just a README.md similar to the archived "browser-extension-autoinjection".

Details for the current @opentelemetry/instrumentation-redis-4 package:

  • "plugins/node/opentelemetry-instrumentation-redis-4" stays in the same dir (in anticipation of chore: rename workspace dirs to match the base of the package name #2223 being revived, and avoiding two directory moves).
  • However, it changes to being published as @opentelemetry/instrumentation-redis.
  • @opentelemetry/auto-instrumentations-node updates to this new release and removes @opentelemetry/instrumentation-redis-4 -- effectively dropping support for redis@2 and redis@3.
  • The @opentelemetry/instrumentation-redis-4 package in npm is marked deprecated with a pointer to the new package and issue explaining the move.
  • Separately, support for redis@5 is added to the new @opentelemetry/instrumentation-redis package.
  • (Possibly the new package release could jump a number of minor versions as a signal of significant change, e.g. from 0.48.0 to 0.100.0 or something.)
  • The @opentelemetry/redis-common package is deprecated, moved to the "archive/" dir, and its (small) code is moved into the modern instr-redis package.

Open questions:

  • Q1: Do we want to do a single release of @opentelemetry/instrumentation-redis-legacy so that it is relatively straightforward for a user to install both the legacy and modern redis instrumentations in the same app (without having the use npm package aliases) to instrument old and modern versions of redis?

Troubleshooting:

  • A user with manual OTel bootstrap code that uses instr-redis and instr-redis-4 and naively updates to latest will get double instrumentation of redis@4. We could consider a final release of instr-redis-4 that disables itself by default.
  • Users that update to the latest auto-instrumentations-node and that have getNodeAutoInstrumentations({'@opentelemetry/instrumentation-redis-4': ...}) will have that config no longer apply. We could update getNodeAutoInstrumentations to support the old ...-redis-4 configuration key with a deprecation warning for a period of time.

Alternatives considered

  • I briefly considered updating instrumentation-redis to support redis 2, 3, and 4 by merging in the code in "plugins/node/opentelemetry-instrumentation-redis-4". I think this would be straightforward. However, given how old redis 2 and 3 are, it seemed like a waste of time. Redis 3 is four years old at this point. Is there value in supporting it? In addition, some of the same coordination with auto-instrumentation-node above would need to be done. I'm not totally opposed to this alternative.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions