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
1 change: 1 addition & 0 deletions sentry_sdk/integrations/clickhouse_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def _inner(*args: "P.args", **kwargs: "P.kwargs") -> "T":
attributes={
"sentry.op": OP.DB,
"sentry.origin": ClickhouseDriverIntegration.origin,
SPANDATA.DB_QUERY_TEXT: str(query),
},
)
else:
Expand Down
21 changes: 20 additions & 1 deletion tests/integrations/clickhouse_driver/test_clickhouse_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ def test_clickhouse_client_spans(
sentry_init,
capture_events,
capture_items,
capture_envelopes,
span_streaming,
):
sentry_init(
Expand Down Expand Up @@ -278,6 +277,7 @@ def test_clickhouse_client_spans(
"db.namespace": "",
"db.user": "default",
"sentry.op": "db",
"db.query.text": "DROP TABLE IF EXISTS test",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
"server.port": 9000,
Expand All @@ -293,6 +293,7 @@ def test_clickhouse_client_spans(
"db.namespace": "",
"db.user": "default",
"sentry.op": "db",
"db.query.text": "CREATE TABLE test (x Int32) ENGINE = Memory",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
"server.port": 9000,
Expand All @@ -308,6 +309,7 @@ def test_clickhouse_client_spans(
"db.namespace": "",
"db.user": "default",
"sentry.op": "db",
"db.query.text": "INSERT INTO test (x) VALUES",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
"server.port": 9000,
Expand All @@ -323,6 +325,7 @@ def test_clickhouse_client_spans(
"db.namespace": "",
"db.user": "default",
"sentry.op": "db",
"db.query.text": "INSERT INTO test (x) VALUES",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
"server.port": 9000,
Expand All @@ -338,6 +341,7 @@ def test_clickhouse_client_spans(
"db.namespace": "",
"db.user": "default",
"sentry.op": "db",
"db.query.text": "SELECT sum(x) FROM test WHERE x > 150",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
"server.port": 9000,
Expand Down Expand Up @@ -563,6 +567,7 @@ def test_clickhouse_client_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "DROP TABLE IF EXISTS test",
"server.address": "localhost",
"server.port": 9000,
"thread.id": mock.ANY,
Expand All @@ -577,6 +582,7 @@ def test_clickhouse_client_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "CREATE TABLE test (x Int32) ENGINE = Memory",
"server.address": "localhost",
"server.port": 9000,
"thread.id": mock.ANY,
Expand All @@ -591,6 +597,7 @@ def test_clickhouse_client_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "INSERT INTO test (x) VALUES",
"server.address": "localhost",
"server.port": 9000,
"thread.id": mock.ANY,
Expand All @@ -605,6 +612,7 @@ def test_clickhouse_client_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "INSERT INTO test (x) VALUES",
"server.address": "localhost",
"server.port": 9000,
},
Expand All @@ -617,6 +625,7 @@ def test_clickhouse_client_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "SELECT sum(x) FROM test WHERE x > 150",
"server.address": "localhost",
"server.port": 9000,
},
Expand Down Expand Up @@ -1012,6 +1021,7 @@ def test_clickhouse_dbapi_spans(
"db.driver.name": "clickhouse-driver",
"db.namespace": "",
"db.user": "default",
"db.query.text": "DROP TABLE IF EXISTS test",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand All @@ -1027,6 +1037,7 @@ def test_clickhouse_dbapi_spans(
"db.driver.name": "clickhouse-driver",
"db.namespace": "",
"db.user": "default",
"db.query.text": "CREATE TABLE test (x Int32) ENGINE = Memory",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand All @@ -1042,6 +1053,7 @@ def test_clickhouse_dbapi_spans(
"db.driver.name": "clickhouse-driver",
"db.namespace": "",
"db.user": "default",
"db.query.text": "INSERT INTO test (x) VALUES",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand All @@ -1057,6 +1069,7 @@ def test_clickhouse_dbapi_spans(
"db.driver.name": "clickhouse-driver",
"db.namespace": "",
"db.user": "default",
"db.query.text": "INSERT INTO test (x) VALUES",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand All @@ -1072,6 +1085,7 @@ def test_clickhouse_dbapi_spans(
"db.driver.name": "clickhouse-driver",
"db.namespace": "",
"db.user": "default",
"db.query.text": "SELECT sum(x) FROM test WHERE x > 150",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand Down Expand Up @@ -1266,6 +1280,7 @@ def test_clickhouse_dbapi_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "DROP TABLE IF EXISTS test",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand All @@ -1280,6 +1295,7 @@ def test_clickhouse_dbapi_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "CREATE TABLE test (x Int32) ENGINE = Memory",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand All @@ -1294,6 +1310,7 @@ def test_clickhouse_dbapi_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "INSERT INTO test (x) VALUES",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand All @@ -1308,6 +1325,7 @@ def test_clickhouse_dbapi_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "INSERT INTO test (x) VALUES",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand All @@ -1322,6 +1340,7 @@ def test_clickhouse_dbapi_spans_with_pii(
"db.system.name": "clickhouse",
"db.namespace": "",
"db.user": "default",
"db.query.text": "SELECT sum(x) FROM test WHERE x > 150",
"sentry.op": "db",
"sentry.origin": "auto.db.clickhouse_driver",
"server.address": "localhost",
Expand Down
Loading