Skip to content

Commit 649c3ad

Browse files
committed
dont pass opts around
1 parent a62d90b commit 649c3ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sentry_sdk/scope.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ def _apply_flags_to_event(
14611461
)
14621462

14631463
def _apply_global_attributes_to_telemetry(
1464-
self, telemetry: "Union[Log, Metric]", options: "dict[str, Any]"
1464+
self, telemetry: "Union[Log, Metric]"
14651465
) -> None:
14661466
# TODO: Global stuff like this should just be retrieved at init time and
14671467
# put onto the global scope's attributes and then applied to events
@@ -1473,6 +1473,8 @@ def _apply_global_attributes_to_telemetry(
14731473
attributes["sentry.sdk.name"] = SDK_INFO["name"]
14741474
attributes["sentry.sdk.version"] = SDK_INFO["version"]
14751475

1476+
options = self.get_client().options
1477+
14761478
server_name = options.get("server_name")
14771479
if server_name is not None and SPANDATA.SERVER_ADDRESS not in attributes:
14781480
attributes[SPANDATA.SERVER_ADDRESS] = server_name
@@ -1611,8 +1613,6 @@ def apply_to_event(
16111613
def apply_to_telemetry(self, telemetry: "Union[Log, Metric]") -> None:
16121614
# Attributes-based events and telemetry go through here (logs, metrics,
16131615
# spansV2)
1614-
options = self.get_client().options
1615-
16161616
trace_context = self.get_trace_context()
16171617
trace_id = trace_context.get("trace_id")
16181618
if telemetry.get("trace_id") is None:
@@ -1621,7 +1621,7 @@ def apply_to_telemetry(self, telemetry: "Union[Log, Metric]") -> None:
16211621
if telemetry.get("span_id") is None and span_id:
16221622
telemetry["span_id"] = span_id
16231623

1624-
self._apply_global_attributes_to_telemetry(telemetry, options)
1624+
self._apply_global_attributes_to_telemetry(telemetry)
16251625
self._apply_user_attributes_to_telemetry(telemetry)
16261626

16271627
def update_from_scope(self, scope: "Scope") -> None:

0 commit comments

Comments
 (0)