Skip to content

feat(clickhouse_driver): Support span streaming#6508

Open
alexander-alderman-webb wants to merge 4 commits into
masterfrom
webb/clickhouse-driver/span-first
Open

feat(clickhouse_driver): Support span streaming#6508
alexander-alderman-webb wants to merge 4 commits into
masterfrom
webb/clickhouse-driver/span-first

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Jun 5, 2026

Description

In the streaming path, use

  • db.namespace instead of db.name
  • db.system.name instead of db.system

Dropped attributes:

  • db.params
  • db.result
  • query
  • db.query_id

Tests for adding breadcrumbs based on spans have not been parametrized as breadcrumbs are not automatically created from spans with the new streaming lifecycle.

Adapting Tests

sed commands used for converting transaction context managers:

  • sed -i '' 's/start_transaction(name="test_clickhouse_transaction") as transaction:/sentry_sdk.traces.start_span(name="custom parent") as span:/g'
  • sed -i '' 's/start_transaction(name="test_clickhouse_transaction"):/sentry_sdk.traces.start_span(name="custom parent"):/g'

sed commands used for converting event capture:

  • sed -i '' 's/capture_events,/capture_items,/g'
  • sed -i '' 's/events = capture_events()/items = capture_items("event", "transaction", "span")/g'
  • sed -i '' 's/event["spans"]/spans/g'

sed commands used for converting op:

  • sed -i '' 's/"op"/"sentry.op"/g'

sed commands used for converting origin:

  • sed -i '' 's/"origin"/"sentry.origin"/g'

sed commands used for converting description:

sed -i '' 's/"description"/"name"/g'

sed commands used for converting data to attributes:

  • sed -i '' 's/"data"/"attributes"/g'

sed commands used for converting timestamps:

other test changes:

  • sed -i '' 's/transaction_trace_id/trace_id/g'
  • sed -i '' 's/transaction_span_id/span_id/g'
  • sed -i '' 's/transaction.trace_id/span.trace_id/g'
  • sed -i '' 's/transaction.span_id/span.span_id/g'
  • sed -i '' '/same_process_as_parent/d'
  • sed -i '' '/db.result/d'
  • sed -i '' '/db.params/d'
  • sed -i '' 's/"timestamp"/"end_timestamp"/g'
  • sed -i '' 's/"db.system"/"db.system.name"/g'
  • sed -i '' 's/"db.name"/"db.namespace"/g'

Issues

Closes #6011

Reminders

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review June 5, 2026 12:40
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner June 5, 2026 12:40
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Codecov Results 📊

88555 passed | ⏭️ 6025 skipped | Total: 94580 | Pass Rate: 93.63% | Execution Time: 299m 17s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +15
Passed Tests 📈 +15
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 91.43%. Project has 2486 uncovered lines.
✅ Project coverage is 89.34%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/clickhouse_driver.py 91.43% ⚠️ 3 Missing and 3 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.34%    89.34%        —%
==========================================
  Files          192       192         —
  Lines        23302     23321       +19
  Branches      8010      8022       +12
==========================================
+ Hits         20819     20835       +16
- Misses        2483      2486        +3
- Partials      1312      1314        +2

Generated by Codecov Action

Comment thread tests/integrations/clickhouse_driver/test_clickhouse_driver.py
Comment thread tests/integrations/clickhouse_driver/test_clickhouse_driver.py
Comment thread sentry_sdk/integrations/clickhouse_driver.py
Comment thread tests/integrations/clickhouse_driver/test_clickhouse_driver.py
Comment thread sentry_sdk/integrations/clickhouse_driver.py
Comment thread sentry_sdk/integrations/clickhouse_driver.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate clickhouse_driver to span first

1 participant