Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/clickhouse_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _inner_end(*args: "P.args", **kwargs: "P.kwargs") -> "T":
sentry_sdk.get_isolation_scope().add_breadcrumb(
message=query,
category="query",
data={"db.result": res, **breadcrumb_data},
data=breadcrumb_data,
)

span = getattr(instance.connection, "_sentry_span", None)
Expand Down
12 changes: 12 additions & 0 deletions tests/integrations/clickhouse_driver/test_clickhouse_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ def test_clickhouse_client_breadcrumbs_with_pii_span_streaming(
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [],
},
"message": "DROP TABLE IF EXISTS test",
"type": "default",
Expand All @@ -386,6 +387,7 @@ def test_clickhouse_client_breadcrumbs_with_pii_span_streaming(
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [],
},
"message": "CREATE TABLE test (x Int32) ENGINE = Memory",
"type": "default",
Expand Down Expand Up @@ -425,6 +427,7 @@ def test_clickhouse_client_breadcrumbs_with_pii_span_streaming(
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [[370]],
},
"message": "SELECT sum(x) FROM test WHERE x > 150",
"type": "default",
Expand Down Expand Up @@ -576,6 +579,7 @@ def test_clickhouse_client_breadcrumbs_with_data_collection_span_streaming(
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [],
},
"message": "DROP TABLE IF EXISTS test",
"type": "default",
Expand All @@ -589,6 +593,7 @@ def test_clickhouse_client_breadcrumbs_with_data_collection_span_streaming(
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [],
},
"message": "CREATE TABLE test (x Int32) ENGINE = Memory",
"type": "default",
Expand Down Expand Up @@ -628,6 +633,7 @@ def test_clickhouse_client_breadcrumbs_with_data_collection_span_streaming(
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [[370]],
},
"message": "SELECT sum(x) FROM test WHERE x > 150",
"type": "default",
Expand Down Expand Up @@ -1179,6 +1185,7 @@ def test_clickhouse_client_breadcrumbs_with_data_collection_default_span_streami
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [],
},
"message": "DROP TABLE IF EXISTS test",
"type": "default",
Expand All @@ -1192,6 +1199,7 @@ def test_clickhouse_client_breadcrumbs_with_data_collection_default_span_streami
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [],
},
"message": "CREATE TABLE test (x Int32) ENGINE = Memory",
"type": "default",
Expand Down Expand Up @@ -1231,6 +1239,7 @@ def test_clickhouse_client_breadcrumbs_with_data_collection_default_span_streami
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [[370]],
},
"message": "SELECT sum(x) FROM test WHERE x > 150",
"type": "default",
Expand Down Expand Up @@ -2289,6 +2298,7 @@ def test_clickhouse_dbapi_breadcrumbs_with_pii_span_streaming(
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [[], []],
},
"message": "DROP TABLE IF EXISTS test",
"type": "default",
Expand All @@ -2302,6 +2312,7 @@ def test_clickhouse_dbapi_breadcrumbs_with_pii_span_streaming(
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [[], []],
},
"message": "CREATE TABLE test (x Int32) ENGINE = Memory",
"type": "default",
Expand Down Expand Up @@ -2341,6 +2352,7 @@ def test_clickhouse_dbapi_breadcrumbs_with_pii_span_streaming(
"db.user": "default",
"server.address": "localhost",
"server.port": 9000,
"db.result": [[["370"]], [["'sum(x)'", "'Int64'"]]],
},
"message": "SELECT sum(x) FROM test WHERE x > 150",
"type": "default",
Expand Down
Loading