getsentry / getsentry/sentry-python

Django cache.add operations do not emit cache spans

オープン
#6,402 コメント 1 件 リアクション 0 件 担当者 1 名 @immanuwell が担当を希望しています GitHub で見る
Bug Python Spans
主要言語
Python
スター
2.2k
フォーク
669
平均マージ
1日 40分
マージ済み PR(30日)
212

説明

### 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

```py
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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。