Thanks to visit codestin.com
Credit goes to github.com

Skip to content

redis-py adds async Cluster PubSub — new instrumentation opportunity #840

Description

@mitchh456

Background

redis-py merged PR #3736 on March 26, 2026, adding asyncio Redis Cluster PubSub support. Key additions:

  • New ClusterPubSub class with per-node routing and connection pool management
  • RedisCluster.pubsub() factory that can bind to a specific node or lazily select one
  • Extended asyncio PubSub to track shard channels (SSUBSCRIBE/SUNSUBSCRIBE)
  • Built-in observability recording for smessage events
  • Resubscription on reconnect for shard channels

Impact

redis-py is a key library that Scout instruments for database query monitoring. This PR introduces a new code path for async Cluster PubSub that:

  1. Has built-in observability hooks — The smessage event recording means redis-py is investing in first-party observability, potentially complementing Scout's instrumentation.
  2. New async API surface — If Scout users run Redis Cluster with PubSub in async Python applications, this is a new area that could benefit from APM visibility (subscribe/unsubscribe latency, message throughput).
  3. Connection pool changes — The new per-node connection management may affect how Scout traces redis connections in cluster mode.

Suggested Action

  1. Review the merged PR to understand the new ClusterPubSub API and its observability hooks.
  2. Evaluate whether Scout should instrument the new async Cluster PubSub operations (subscribe, unsubscribe, message handling) for latency and throughput visibility.
  3. Verify existing redis-py instrumentation continues to work correctly with the updated connection pool behavior in cluster mode.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    botworkIssues created by automated tooling

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions