Skip to content

Commit eb90689

Browse files
committed
Revert "fix: Rename op db to db.query (#4444)"
This reverts commit 84187ea.
1 parent 84187ea commit eb90689

File tree

14 files changed

+84
-86
lines changed

14 files changed

+84
-86
lines changed

MIGRATION_GUIDE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
1919
- The `sentry_sdk.Scope()` constructor no longer accepts a `client` parameter.
2020
- `Span.finish()` does not accept a `hub` parameter anymore.
2121
- `Span.finish()` no longer returns the `event_id` if the event is sent to sentry.
22-
- Some integrations were creating spans with `op` `db`. This was changed to `db.query`.
2322
- The `Profile()` constructor does not accept a `hub` parameter anymore.
2423
- A `Profile` object does not have a `.hub` property anymore.
2524
- `MAX_PROFILE_DURATION_NS`, `PROFILE_MINIMUM_SAMPLES`, `Profile`, `Scheduler`, `ThreadScheduler`, `GeventScheduler`, `has_profiling_enabled`, `setup_profiler`, `teardown_profiler` are no longer accessible from `sentry_sdk.profiler`. They're still accessible from `sentry_sdk.profiler.transaction_profiler`.
@@ -32,7 +31,6 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
3231
- We updated how we handle `ExceptionGroup`s. You will now get more data if ExceptionGroups are appearing in chained exceptions. It could happen that after updating the SDK the grouping of issues change because of this. So eventually you will see the same exception in two Sentry issues (one from before the update, one from after the update)
3332
- The integration for Python `logging` module does not send Sentry issues by default anymore when calling `logging.error()`, `logging.critical()` or `logging.exception()`. If you want to preserve the old behavior use `sentry_sdk.init(integrations=[LoggingIntegration(event_level="ERROR")])`.
3433
- The `SentrySpanProcessor` and `SentryPropagator` are exported from `sentry_sdk.opentelemetry` instead of `sentry_sdk.integrations.opentelemetry`.
35-
- PyMongo breadcrumb type was changed from `db` to `query`.
3634
- The integration-specific content of the `sampling_context` argument of `traces_sampler` and `profiles_sampler` now looks different.
3735

3836
- The Celery integration doesn't add the `celery_job` dictionary anymore. Instead, the individual keys are now available as:

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ class OP:
496496
CACHE_PUT = "cache.put"
497497
COHERE_CHAT_COMPLETIONS_CREATE = "ai.chat_completions.create.cohere"
498498
COHERE_EMBEDDINGS_CREATE = "ai.embeddings.create.cohere"
499-
DB_QUERY = "db.query"
499+
DB = "db"
500500
DB_REDIS = "db.redis"
501501
EVENT_DJANGO = "event.django"
502502
FUNCTION = "function"

sentry_sdk/integrations/asyncpg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ async def _inner(*args: Any, **kwargs: Any) -> T:
163163
return await f(*args, **kwargs)
164164

165165
with sentry_sdk.start_span(
166-
op=OP.DB_QUERY,
166+
op=OP.DB,
167167
name="connect",
168168
origin=AsyncPGIntegration.origin,
169169
only_if_parent=True,

sentry_sdk/integrations/clickhouse_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _inner(*args: P.args, **kwargs: P.kwargs) -> T:
8585
params = args[3] if len(args) > 3 else kwargs.get("params")
8686

8787
span = sentry_sdk.start_span(
88-
op=OP.DB_QUERY,
88+
op=OP.DB,
8989
name=query,
9090
origin=ClickhouseDriverIntegration.origin,
9191
only_if_parent=True,

sentry_sdk/integrations/django/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ def connect(self):
660660
sentry_sdk.add_breadcrumb(message="connect", category="query")
661661

662662
with sentry_sdk.start_span(
663-
op=OP.DB_QUERY,
663+
op=OP.DB,
664664
name="connect",
665665
origin=DjangoIntegration.origin_db,
666666
only_if_parent=True,

sentry_sdk/integrations/pymongo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ def started(self, event):
150150

151151
query = _serialize_span_attribute(command)
152152
span = sentry_sdk.start_span(
153-
op=OP.DB_QUERY,
153+
op=OP.DB,
154154
name=query,
155155
origin=PyMongoIntegration.origin,
156156
only_if_parent=True,
157157
)
158158

159159
with capture_internal_exceptions():
160160
sentry_sdk.add_breadcrumb(
161-
message=query, category="query", type="query", data=data
161+
message=query, category="query", type=OP.DB, data=data
162162
)
163163

164164
for key, value in data.items():

sentry_sdk/opentelemetry/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def span_data_for_db_query(span):
219219
# type: (ReadableSpan) -> OtelExtractedSpanData
220220
span_attributes = span.attributes or {}
221221

222-
op = cast("str", span_attributes.get(SentrySpanAttribute.OP, OP.DB_QUERY))
222+
op = cast("str", span_attributes.get(SentrySpanAttribute.OP, OP.DB))
223223

224224
statement = span_attributes.get(SpanAttributes.DB_STATEMENT, None)
225225
statement = cast("Optional[str]", statement)

sentry_sdk/tracing_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def record_sql_queries(
151151
sentry_sdk.add_breadcrumb(message=query, category="query", data=data)
152152

153153
with sentry_sdk.start_span(
154-
op=OP.DB_QUERY,
154+
op=OP.DB,
155155
name=query,
156156
origin=span_origin,
157157
only_if_parent=True,

0 commit comments

Comments
 (0)