Added async recorder functions#3955
Conversation
There was a problem hiding this comment.
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.recorderwith 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.
|
auggie review |
🤖 Augment PR SummarySummary: This PR adds an async observability recorder layer for redis-py’s asyncio clients. Changes:
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 👎 |
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:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.