Skip to content

feat(redis): add clientInfoTag support with version detection#736

Open
vchomakov wants to merge 1 commit intounjs:mainfrom
vchomakov:feat/redis-client-info-tag
Open

feat(redis): add clientInfoTag support with version detection#736
vchomakov wants to merge 1 commit intounjs:mainfrom
vchomakov:feat/redis-client-info-tag

Conversation

@vchomakov
Copy link

Resolves #735

Description

Adds clientInfoTag support to the Redis driver to leverage Redis's CLIENT SETINFO command.

This feature helps Redis administrators identify which higher-level library is using ioredis by setting a custom tag in the CLIENT SETINFO LIB-NAME command.

Changes

  • Added clientInfoTag option to RedisOptions interface
  • Automatically sets tag to unstorage_vX.X.X using package.json version
  • Supports custom clientInfoTag override
  • Handles cluster mode by passing tag through clusterOptions.redisOptions
  • Added tests for default and custom clientInfoTag behavior
  • Updated documentation

Example Usage

// Default behavior - automatically includes version
const storage = createStorage({
  driver: redisDriver({
    host: 'localhost',
    port: 6379
  })
});
// Results in: CLIENT SETINFO LIB-NAME ioredis(unstorage_v2.0.0-alpha.5)

// Custom tag
const storage = createStorage({
  driver: redisDriver({
    host: 'localhost',
    port: 6379,
    clientInfoTag: 'my-app_v1.0.0'
  })
});
// Results in: CLIENT SETINFO LIB-NAME ioredis(my-app_v1.0.0)

Testing

All existing tests pass (19/19)
Added 2 new tests for clientInfoTag functionality
Build successful
Linter passes
Type checking passes

References

Redis CLIENT SETINFO documentation: https://redis.io/docs/latest/commands/client-setinfo/
ioredis clientInfoTag option: https://github.com/redis/ioredis#client-setinfo

@vchomakov vchomakov requested a review from pi0 as a code owner January 27, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add clientInfoTag support to Redis driver

1 participant