davsclaus commented on code in PR #22612:
URL: https://github.com/apache/camel/pull/22612#discussion_r3088447546


##########
components/camel-opentelemetry2/src/main/java/org/apache/camel/opentelemetry2/OpenTelemetrySpanAdapter.java:
##########
@@ -16,38 +16,82 @@
  */
 package org.apache.camel.opentelemetry2;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import io.opentelemetry.api.baggage.Baggage;
 import io.opentelemetry.api.common.Attributes;
 import io.opentelemetry.api.common.AttributesBuilder;
 import io.opentelemetry.api.trace.Span;
+import io.opentelemetry.api.trace.SpanBuilder;
+import io.opentelemetry.api.trace.SpanKind;
 import io.opentelemetry.api.trace.StatusCode;
 import io.opentelemetry.context.Scope;
+import org.apache.camel.telemetry.Op;
 import org.apache.camel.telemetry.TagConstants;
 
 public class OpenTelemetrySpanAdapter implements 
org.apache.camel.telemetry.Span {
 
     private static final String DEFAULT_EVENT_NAME = "log";
     static final String BAGGAGE_CAMEL_FLAG = "camelScope";
 
-    private final Span otelSpan;
+    private Span otelSpan;
     private final Baggage baggage;
     private Scope scope;
     private Scope baggageScope;
 
-    protected OpenTelemetrySpanAdapter(Span otelSpan, Baggage baggage) {
-        this.otelSpan = otelSpan;
-        // We store an important flag in the baggage in order to verify if the
-        // root span was generated internally or from a third party dependency.
-        this.baggage = baggage.toBuilder().put(BAGGAGE_CAMEL_FLAG, 
"true").build();
+    // For deferred span creation
+    private SpanBuilder spanBuilder;
+    private final Map<String, String> pendingTags = new HashMap<>();

Review Comment:
   should these map/list be concurrent variants in case multi threads calls at 
the same time



-- 
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