fix: Add breadcrumb description (#489) · gitcommit90/sentry-python@fb9135d · GitHub
Skip to content

Commit fb9135d

Browse files
authored
fix: Add breadcrumb description (getsentry#489)
* fix: Add breadcrumb description * fix: Fix more breadcrumb descriptions * fix: Formatting
1 parent fff3f5a commit fb9135d

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

sentry_sdk/integrations/redis.py

Lines changed: 3 additions & 0 deletions

sentry_sdk/tracing.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ def record_http_request(hub, url, method):
394394
def _maybe_create_breadcrumbs_from_span(hub, span):
395395
# type: (sentry_sdk.Hub, Span) -> None
396396
if span.op == "redis":
397-
hub.add_breadcrumb(type="redis", category="redis", data=span._tags)
397+
hub.add_breadcrumb(
398+
message=span.description, type="redis", category="redis", data=span._tags
399+
)
398400
elif span.op == "http" and span.is_success():
399401
hub.add_breadcrumb(
400402
type="http",
@@ -406,6 +408,7 @@ def _maybe_create_breadcrumbs_from_span(hub, span):
406408
hub.add_breadcrumb(
407409
type="subprocess",
408410
category="subprocess",
411+
message=span.description,
409412
data=span._data,
410413
hint={"popen_instance": span._data.get("popen_instance")},
411414
)

tests/integrations/redis/test_redis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def test_basic(sentry_init, capture_events):
1818

1919
assert crumb == {
2020
"category": "redis",
21-
"data": {"redis.key": "foobar"},
21+
"message": "GET 'foobar'",
22+
"data": {"redis.key": "foobar", "redis.command": "GET"},
2223
"timestamp": crumb["timestamp"],
2324
"type": "redis",
2425
}

tests/integrations/stdlib/test_subprocess.py

Lines changed: 6 additions & 1 deletion

0 commit comments

Comments
 (0)