Skip to content

Commit f0703b3

Browse files
authored
Set correct span op (#3628)
Set the correct span `op` for database spans, instead of the generic `"db"`.
1 parent f266415 commit f0703b3

File tree

1 file changed

+2
-2
lines changed
  • sentry_sdk/integrations/opentelemetry

1 file changed

+2
-2
lines changed

sentry_sdk/integrations/opentelemetry/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import sentry_sdk
1919
from sentry_sdk.utils import Dsn
20-
from sentry_sdk.consts import SPANSTATUS
20+
from sentry_sdk.consts import SPANSTATUS, OP
2121
from sentry_sdk.tracing import get_span_status_from_http_code, DEFAULT_SPAN_ORIGIN
2222
from sentry_sdk.tracing_utils import Baggage
2323
from sentry_sdk.integrations.opentelemetry.consts import SentrySpanAttribute
@@ -182,7 +182,7 @@ def span_data_for_db_query(span):
182182
# type: (ReadableSpan) -> OtelExtractedSpanData
183183
span_attributes = span.attributes or {}
184184

185-
op = "db"
185+
op = span_attributes.get(SentrySpanAttribute.OP, OP.DB)
186186

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

0 commit comments

Comments
 (0)