Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change set_attributes to take a Mapping #4374

Merged
merged 2 commits into from
Jan 15, 2025
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
4 changes: 2 additions & 2 deletions opentelemetry-api/src/opentelemetry/trace/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_span_context(self) -> "SpanContext":

@abc.abstractmethod
def set_attributes(
self, attributes: typing.Dict[str, types.AttributeValue]
self, attributes: typing.Mapping[str, types.AttributeValue]
) -> None:
"""Sets Attributes.

Expand Down Expand Up @@ -529,7 +529,7 @@ def end(self, end_time: typing.Optional[int] = None) -> None:
pass

def set_attributes(
self, attributes: typing.Dict[str, types.AttributeValue]
self, attributes: typing.Mapping[str, types.AttributeValue]
) -> None:
pass

Expand Down
3 changes: 2 additions & 1 deletion opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
Dict,
Iterator,
List,
Mapping,
MutableMapping,
Optional,
Sequence,
Expand Down Expand Up @@ -842,7 +843,7 @@ def get_span_context(self):
return self._context

def set_attributes(
self, attributes: Dict[str, types.AttributeValue]
self, attributes: Mapping[str, types.AttributeValue]
) -> None:
with self._lock:
if self._end_time is not None:
Expand Down
Loading