streamnative / pulsar-tracing

Tracing instrumentation for Apache Pulsar clients.
Apache License 2.0
20 stars 10 forks source link

Questions about producer behaviors #11

Closed ABNER-1 closed 3 years ago

ABNER-1 commented 3 years ago

Thans for this good job.

When studying the code about this project, I have been confused by the producer interceptor behavior which injects unfinished span to tracer. Meanwhile, I have noticed the jaeger ui result that the span indeed finished. How it worked?

Will this be finished by other function in the feature milestones? Will this opetation cause memory leak?

Thank you very much.

codelipenghui commented 3 years ago

@ABNER-1 Could you please provide an example, I'm not sure where the problem is. Do you mean finished is the trace finished or span finished?

ABNER-1 commented 3 years ago

Sorry, I have noticed in this code ending, span finshed.

   @Override
    public Message<?> beforeSend(Producer producer, Message message) {
        Tracer tracer = GlobalTracer.get();
        TracingPulsarUtils.buildAndInjectSpan(message, producer, tracer).finish();
        return message;
    }

Thank you for replying.