dd-trace-java icon indicating copy to clipboard operation
dd-trace-java copied to clipboard

Question: why we use spanId and rootSpanId to correlate profiles with traces

Open steverao opened this issue 10 months ago • 0 comments

Hi everyone!

I have a question about the profile module in the codebase. Specifically, I would like to understand why we use spanId and rootSpanId to correlate profiles with traces in Datadog's dd-trace-java repository.

In my opinion, there are several approaches to correlating profiles with traces:

  1. Use traceId and spanId to correlate each span with the related profile data.
  2. Use traceId to correlate the entire trace with the related profile data.

However, I noticed that we use spanId and rootSpanId in the dd-trace-java project. Is there any deeper consideration behind this choice?

I hope to receive your response. Thank you very much!

steverao avatar Jan 06 '25 10:01 steverao