Skip to content

Add Flask-Caching version identification to Redis connections #630

@vchomakov

Description

@vchomakov

Feature Request

Description

Add client identification to Redis connections created by Flask-Caching using the lib_name and lib_version parameters supported by redis-py.

Motivation

Redis servers support the lib_name and lib_version parameters (introduced in redis-py) to help operators identify which upstream libraries are connecting to their servers. This improves observability and debugging for Redis operators.

Currently, Flask-Caching doesn't set these parameters, so Redis operators cannot easily identify Flask-Caching connections.

Proposed Solution

  • Set lib_name to redis-py(flask-caching_v<version>) following the redis-py convention for third-party libraries
  • Set lib_version to the redis-py version
  • Apply to all three Redis backend types: RedisCache, RedisSentinelCache, and RedisClusterCache
  • Only set these parameters if not already provided by the user
  • Follow redis-py best practices as documented in the CLIENT SETINFO command documentation

Example

With Flask-Caching v2.3.1 and redis-py v5.0.8:

  • lib_name: redis-py(flask-caching_v2.3.1)
  • lib_version: 5.0.8

Metadata

Metadata

Assignees

No one assigned

    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