ferruzzi commented on code in PR #37948:
URL: https://github.com/apache/airflow/pull/37948#discussion_r1525236936


##########
airflow/traces/otel_tracer.py:
##########
@@ -104,36 +98,34 @@ def start_span(
         links=None,
         start_time=None,
     ):
-        """Start a span. if service_name is not given, otel_service is used."""
+        """Start a span; if service_name is not given, otel_service is used."""
         if component is None:
             component = self.otel_service
 
         trace_id = self.get_current_span().get_span_context().trace_id
         if span_id is not None:
-            tracer = self.get_tracer_with_id(component=component, 
trace_id=trace_id, span_id=span_id)
+            tracer = self.get_tracer(component=component, trace_id=trace_id, 
span_id=span_id)
         else:
             tracer = self.get_tracer(component)
 
-        kvs = {}
-        if self.tags is not None:
-            kvs = parse_tracestate(self.tags)
+        attributes = parse_tracestate(self.tag_string) if self.tag_string else 
{}
 
         if links is not None:
             _links = gen_links_from_kv_list(links)
         else:
             _links = []
 
         if start_time is not None:
-            start_time = int(start_time.timestamp() * 1000000000)
+            start_time = datetime_to_nano(start_time)
 
         if parent_sc is not None:
             ctx = trace.set_span_in_context(NonRecordingSpan(parent_sc))
             span = tracer.start_as_current_span(
-                span_name, context=ctx, attributes=kvs, links=_links, 
start_time=start_time
+                span_name, context=ctx, attributes=attributes, links=_links, 
start_time=start_time
             )
         else:
             span = tracer.start_as_current_span(
-                span_name, attributes=kvs, links=_links, start_time=start_time
+                span_name, attributes=attributes, links=_links, 
start_time=start_time
             )

Review Comment:
   Ah, That's what I was afraid of.  Thanks for trying it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to