Skip to content

Commit 48e40d4

Browse files
committed
send as integer instead of strings
1 parent 38f95a2 commit 48e40d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sentry_sdk/_log_batcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def format_attribute(val):
104104
if isinstance(val, bool):
105105
return {"value": val, "type": "boolean"}
106106
if isinstance(val, int):
107-
return {"value": str(val), "type": "integer"}
107+
return {"value": val, "type": "integer"}
108108
if isinstance(val, float):
109109
return {"value": val, "type": "double"}
110110
if isinstance(val, str):

tests/test_logs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ def otel_attributes_to_dict(otel_attrs):
2323
def _convert_attr(attr):
2424
# type: (Mapping[str, Union[str, float, bool]]) -> Any
2525
if attr["type"] == "boolean":
26-
return bool(attr["value"])
26+
return attr["value"]
2727
if attr["type"] == "double":
28-
return float(attr["value"])
28+
return attr["value"]
2929
if attr["type"] == "integer":
30-
return int(attr["value"])
30+
return attr["value"]
3131
if attr["value"].startswith("{"):
3232
try:
3333
return json.loads(attr["stringValue"])

0 commit comments

Comments
 (0)