Django cache.add operations do not emit cache spans
@immanuwell 已经在做这个了。
开始于 2026年5月26日。
评估
这个 Issue 还没有评估数据。
描述
Problem
DjangoIntegration(cache_spans=True) traces cache.set() and cache.get(), but cache.add() emits no cache span.
cache.add() is a normal Django cache write API, so this shows up in practice for apps that use add-on-miss / write-if-absent flows.
Repro
from django.core.cache import cache
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
sentry_sdk.init(
integrations=[DjangoIntegration(cache_spans=True)],
traces_sample_rate=1.0,
)
with sentry_sdk.start_transaction(name="t", op="test"):
cache.add("k", "value")
Actual: no cache.put span for cache.add().
Expected: cache.add() should be traced like the other cache write methods.
Notes
I verified locally that cache.set() emits a span while cache.add() does not, and a targeted fix is just to instrument add as a cache write.
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 672
- 平均合并
- 23 小时 14 分钟
- 30 天内合并 PR
- 218
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/sentry-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
getsentry/sentry-python#7543 · 2 条评论 · 已指派 1 人 ·
-
Python
难度 2/5 1-3 小时 新手友好度 68/100
getsentry/sentry-python#6992 · 1 条评论 ·
-
Improvement Python
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/sentry-python#6970 · 1 条评论 ·
-
Bug Python
难度 2/5 1-3 小时 新手友好度 74/100
getsentry/sentry-python#6504 · 1 条评论 ·
-
Improvement Python Spans
难度 2/5 1-3 小时 新手友好度 85/100
getsentry/sentry-python#5833 · 1 条评论 ·
查看 getsentry/sentry-python 的全部 Issue
相似的 Issue
-
Add: hunch 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 68/100
DiamondLightSource/dodal#2211 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
openml/openml-python#1749 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
sipyourdrink-ltd/bernstein#6191 ·