Skip to content

fix(api): Only emit API mismatch warnings when client is active#6520

Merged
sentrivana merged 2 commits into
masterfrom
ivana/only-emit-api-mismatch-warnings-on-active-clients
Jun 8, 2026
Merged

fix(api): Only emit API mismatch warnings when client is active#6520
sentrivana merged 2 commits into
masterfrom
ivana/only-emit-api-mismatch-warnings-on-active-clients

Conversation

@sentrivana

Copy link
Copy Markdown
Contributor

Description

When working on the dogfooding branch in Sentry, I've seen warnings emitted about using span streaming API in non streaming mode when that was not the case. The problem is that when the SDK has not been init-ed yet and you use e.g. the new streaming @trace decorator, has_span_streaming_enabled() will return False and it'll appear as though you're using the streaming API in non-streaming mode.

Check whether the SDK/client has actually been initialized before emitting any warnings.

Issues

Reminders

@sentrivana sentrivana marked this pull request as ready for review June 8, 2026 07:57
@sentrivana sentrivana requested a review from a team as a code owner June 8, 2026 07:57
@sentrivana sentrivana enabled auto-merge (squash) June 8, 2026 08:03
@sentrivana sentrivana merged commit 0788e40 into master Jun 8, 2026
143 of 145 checks passed
@sentrivana sentrivana deleted the ivana/only-emit-api-mismatch-warnings-on-active-clients branch June 8, 2026 08:09
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

88776 passed | ⏭️ 6025 skipped | Total: 94801 | Pass Rate: 93.64% | Execution Time: 297m 5s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +713
Passed Tests 📈 +723
Failed Tests 📉 -10
Skipped Tests

➖ Removed Tests (10)

View removed tests
  • test_clickhouse_client_breadcrumbs
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver
  • test_clickhouse_client_breadcrumbs_with_pii
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver
  • test_clickhouse_client_spans
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver
  • test_clickhouse_spans_with_generator
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver
  • test_clickhouse_client_spans_with_pii
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver
  • test_clickhouse_dbapi_breadcrumbs
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver
  • test_clickhouse_dbapi_breadcrumbs_with_pii
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver
  • test_clickhouse_dbapi_spans
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver
  • test_clickhouse_dbapi_spans_with_pii
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver
  • test_span_origin
    • File: tests.integrations.clickhouse_driver.test_clickhouse_driver

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2362 uncovered lines.
✅ Project coverage is 89.87%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
sentry_sdk/tracing_utils.py 100.00% ⚠️ 2 partials
sentry_sdk/traces.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.87%    89.87%        —%
==========================================
  Files          192       192         —
  Lines        23320     23321        +1
  Branches      8020      8020         —
==========================================
+ Hits         20958     20959        +1
- Misses        2362      2362         —
- Partials      1327      1327         —

Generated by Codecov Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants