Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 6c88916

Browse files
felippe-mendoncasongy23
authored andcommitted
fix ZipkinExporter when using BackgroundThreadTransport (#247)
* changed time precision on zipkin exporter to microseconds * fixed tests * fixed line length * fixed translate_to_zipkin function on ZipkinExporter - previously when using BackgroundThreadTransport, all traces were sent with same trace_id
1 parent d665a14 commit 6c88916

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

opencensus/trace/exporters/zipkin_exporter.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ def translate_to_zipkin(self, span_datas):
137137
:returns: List of zipkin format spans.
138138
"""
139139

140-
top_span = span_datas[0]
141-
trace_id = top_span.context.trace_id if top_span.context is not None \
142-
else None
143-
144140
local_endpoint = {
145141
'serviceName': self.service_name,
146142
'port': self.port,
@@ -173,7 +169,7 @@ def translate_to_zipkin(self, span_datas):
173169
duration_ms = end_timestamp_ms - start_timestamp_ms
174170

175171
zipkin_span = {
176-
'traceId': trace_id,
172+
'traceId': span.context.trace_id,
177173
'id': str(span.span_id),
178174
'name': span.name,
179175
'timestamp': int(round(start_timestamp_ms)),

0 commit comments

Comments
 (0)