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

Allow bytes as attributes #3605

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
Prev Previous commit
Next Next commit
lint
adriangb committed Dec 29, 2023
commit ed306ac4a4b352ee5158d76253ac2139cdbc8186
9 changes: 5 additions & 4 deletions opentelemetry-sdk/tests/trace/test_trace.py
Original file line number Diff line number Diff line change
@@ -736,11 +736,12 @@ def test_invalid_attribute_values(self):

def test_byte_type_attribute_value(self):
with self.tracer.start_as_current_span("root") as root:
for key, value in (("arbitrary", b"\xd8\xe1\xb7\xeb\xa8\xe5 \xd2\xb7\xe1"), ("encodable", b"valid byte")):
for key, value in (
("arbitrary", b"\xd8\xe1\xb7\xeb\xa8\xe5 \xd2\xb7\xe1"),
("encodable", b"valid byte"),
):
root.set_attribute(key, b"valid byte")
self.assertTrue(
isinstance(root.attributes[key], bytes)
)
self.assertTrue(isinstance(root.attributes[key], bytes))

def test_sampling_attributes(self):
sampling_attributes = {