Skip to content

feat(redis): Support streaming spans#6083

Draft
sentrivana wants to merge 14 commits intomasterfrom
ivana/port-redis-to-span-first
Draft

feat(redis): Support streaming spans#6083
sentrivana wants to merge 14 commits intomasterfrom
ivana/port-redis-to-span-first

Conversation

@sentrivana
Copy link
Copy Markdown
Contributor

@sentrivana sentrivana commented Apr 16, 2026

Description

Support span streaming in the Redis integration(s).

  • support creating streamed spans
  • move data and tags to attributes
  • make sure attributes are in semantic conventions
  • add tests

The diff is mostly tests 🙏🏻

Issues

Reminders

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 16, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Codecov Results 📊

2099 passed | ⏭️ 169 skipped | Total: 2268 | Pass Rate: 92.55% | Execution Time: 4m 15s

All tests are passing successfully.

❌ Patch coverage is 8.89%. Project has 12570 uncovered lines.

Files with missing lines (6)
File Patch % Lines
utils.py 16.67% ⚠️ 70 Missing
_async_common.py 0.00% ⚠️ 63 Missing
_sync_common.py 18.75% ⚠️ 52 Missing
caches.py 17.46% ⚠️ 52 Missing
queries.py 21.43% ⚠️ 33 Missing
redis_cluster.py 26.47% ⚠️ 25 Missing

Generated by Codecov Action

Comment thread sentry_sdk/integrations/redis/_async_common.py
Comment thread sentry_sdk/integrations/redis/_sync_common.py Outdated
Comment thread sentry_sdk/integrations/redis/utils.py
Comment thread sentry_sdk/integrations/redis/_sync_common.py
Comment thread sentry_sdk/integrations/redis/utils.py
sentrivana and others added 2 commits April 22, 2026 16:49
Parametrize all tracing-related tests in the redis integration with
`span_streaming` [True, False] so they exercise both the streaming and
legacy (static) trace lifecycles.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread tests/integrations/redis/test_redis_cache_module_async.py
Older redis-py versions (e.g. 4.6.0) emit an extra COMMAND span during
RedisCluster initialization. Mirror the legacy branch's handling so the
streaming assertion tolerates it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@sentry-warden sentry-warden Bot left a comment

Choose a reason for hiding this comment

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

Missing exception handling around set_db_data_fn and _set_client_data in async client (sentry_sdk/integrations/redis/_async_common.py:147)

In _sentry_execute_command, the calls to set_db_data_fn(db_span, self) and _set_client_data(db_span, is_cluster, name, *args) are not wrapped in capture_internal_exceptions(). The synchronous counterpart in _sync_common.py wraps these calls (lines 147-149). If these functions raise an exception, it will propagate and could cause the Redis command to fail or leave spans unclosed, affecting user operations.

Identified by Warden find-bugs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate redis to span first

1 participant