Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sentry_sdk/integrations/opentelemetry/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ class SentrySpanAttribute:
ORIGIN = "sentry.origin"
MEASUREMENT = "sentry.measurement"
TAG = "sentry.tag"
NAME = "sentry.name"
13 changes: 10 additions & 3 deletions sentry_sdk/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,7 @@ def __init__(
scope=None, # type: Optional[Scope]
start_timestamp=None, # type: Optional[Union[datetime, float]]
origin=None, # type: Optional[str]
name=None, # type: Optional[str]
**_, # type: dict[str, object]
):
# type: (...) -> None
Expand All @@ -1224,6 +1225,7 @@ def __init__(
self.origin = origin or DEFAULT_SPAN_ORIGIN
self.op = op
self.description = description
self.name = name
if status is not None:
self.set_status(status)

Expand Down Expand Up @@ -1371,7 +1373,7 @@ def op(self):
# type: () -> Optional[str]
from sentry_sdk.integrations.opentelemetry.consts import SentrySpanAttribute

self._otel_span.attributes.get(SentrySpanAttribute.OP)
return self._otel_span.attributes.get(SentrySpanAttribute.OP)

@op.setter
def op(self, value):
Expand All @@ -1384,12 +1386,17 @@ def op(self, value):
@property
def name(self):
# type: () -> str
pass
from sentry_sdk.integrations.opentelemetry.consts import SentrySpanAttribute

return self._otel_span.attributes.get(SentrySpanAttribute.NAME)

@name.setter
def name(self, value):
# type: (str) -> None
pass
from sentry_sdk.integrations.opentelemetry.consts import SentrySpanAttribute

if value is not None:
self._otel_span.set_attribute(SentrySpanAttribute.NAME, value)

@property
def source(self):
Expand Down