Skip to content

Added async recorder functions#3955

Merged
vladvildanov merged 3 commits intofeat/async-observabilityfrom
vv-recorders-async
Feb 17, 2026
Merged

Added async recorder functions#3955
vladvildanov merged 3 commits intofeat/async-observabilityfrom
vv-recorders-async

Conversation

@vladvildanov
Copy link
Collaborator

Description of change

Please provide a description of the change here.

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an async-facing observability recorder API under redis.asyncio.observability, intended to let asyncio client code record the same OpenTelemetry metrics as the existing sync recorder, along with a comprehensive asyncio test suite validating the integration points with OTel instruments.

Changes:

  • Added redis.asyncio.observability.recorder with async wrappers for metric recording (command duration, connection metrics, pubsub, streaming lag, geo failover).
  • Extended RedisMetricsCollector.record_geo_failover() typing to accept async database objects.
  • Added new asyncio-focused observability tests validating correct instrument calls and privacy config behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
redis/asyncio/observability/recorder.py New async recorder API wrapping RedisMetricsCollector for asyncio client usage.
redis/asyncio/observability/__init__.py Package init/docstring for new async observability module.
redis/observability/metrics.py Updates geo failover typing to allow async database objects.
tests/test_asyncio/test_observability/test_recorder.py New unit/integration tests for asyncio recorder behavior and registry-backed observable gauges.
tests/test_asyncio/test_observability/__init__.py Test package init/docstring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vladvildanov
Copy link
Collaborator Author

auggie review

@augmentcode
Copy link

augmentcode bot commented Feb 17, 2026

🤖 Augment PR Summary

Summary: This PR adds an async observability recorder layer for redis-py’s asyncio clients.

Changes:

  • Introduces redis.asyncio.observability as a new asyncio-focused observability module.
  • Adds redis/asyncio/observability/recorder.py with async wrappers for recording metrics (command duration, connection events, errors, pubsub, streaming lag, and geo failover).
  • Implements lazy initialization of a shared RedisMetricsCollector using the existing provider/config infrastructure.
  • Supports observable gauge collection for connection counts via the existing observables registry pattern.
  • Updates RedisMetricsCollector.record_geo_failover typing to accept both sync and async MultiDB database objects.
  • Adds a comprehensive asyncio test suite validating attribute propagation and safe no-op behavior when telemetry is disabled.

Technical Notes: The async recorder reuses the sync observability configuration (e.g., hiding stream/channel names) and aims to keep observability failures from impacting Redis command execution by swallowing exceptions around metric recording.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@vladvildanov vladvildanov merged commit 0b88653 into feat/async-observability Feb 17, 2026
2 checks passed
@vladvildanov vladvildanov deleted the vv-recorders-async branch February 17, 2026 09:55
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.

1 participant