Skip to content

Commit 2679ab2

Browse files
authored
Ensure that serialized IDs are properly padded
1 parent 5769784 commit 2679ab2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/partial_span_processor/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def get_log_data(self, span: Span, attributes: dict[str, str]) -> LogData:
138138
for resource_span in traces_dict.get("resourceSpans", []):
139139
for scope_span in resource_span.get("scopeSpans", []):
140140
for span in scope_span.get("spans", []):
141-
span["traceId"] = hex(span_context.trace_id)[2:]
142-
span["spanId"] = hex(span_context.span_id)[2:]
141+
span["traceId"] = f"{span_context.trace_id:032x}"
142+
span["spanId"] = f"{span_context.span_id:016x}"
143143
if parent:
144-
span["parentSpanId"] = hex(parent.span_id)[2:]
144+
span["parentSpanId"] = f"{parent.span_id:016x}"
145145

146146
serialized_traces_data = json.dumps(traces_dict, separators=(",", ":"))
147147

0 commit comments

Comments
 (0)