Skip to content

Commit e24b244

Browse files
ref(grpc): Use SegmentSource constants for streamed spans (#6542)
1 parent 3bbd78d commit e24b244

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

sentry_sdk/integrations/grpc/aio/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from sentry_sdk.consts import OP
55
from sentry_sdk.integrations import DidNotEnable
66
from sentry_sdk.integrations.grpc.consts import SPAN_ORIGIN
7+
from sentry_sdk.traces import SegmentSource
78
from sentry_sdk.tracing import TransactionSource
89
from sentry_sdk.tracing_utils import has_span_streaming_enabled
910
from sentry_sdk.utils import event_from_exception
@@ -66,7 +67,7 @@ async def wrapped(request: "Any", context: "ServicerContext") -> "Any":
6667
name=name,
6768
attributes={
6869
"sentry.op": OP.GRPC_SERVER,
69-
"sentry.span.source": TransactionSource.CUSTOM.value,
70+
"sentry.span.source": SegmentSource.CUSTOM.value,
7071
"sentry.origin": SPAN_ORIGIN,
7172
},
7273
parent_span=None,

sentry_sdk/integrations/grpc/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from sentry_sdk.consts import OP
55
from sentry_sdk.integrations import DidNotEnable
66
from sentry_sdk.integrations.grpc.consts import SPAN_ORIGIN
7+
from sentry_sdk.traces import SegmentSource
78
from sentry_sdk.tracing import TransactionSource
89
from sentry_sdk.tracing_utils import has_span_streaming_enabled
910

@@ -57,7 +58,7 @@ def behavior(request: "Message", context: "ServicerContext") -> "Message":
5758
name=name,
5859
attributes={
5960
"sentry.op": OP.GRPC_SERVER,
60-
"sentry.span.source": TransactionSource.CUSTOM.value,
61+
"sentry.span.source": SegmentSource.CUSTOM.value,
6162
"sentry.origin": SPAN_ORIGIN,
6263
},
6364
parent_span=None,

0 commit comments

Comments
 (0)