How the the average time is calculated in the service graph

Hi,

I am implementing traces in the application i am using c++ sdk for implementation. I am facing one issue in the service graph creation.

Consider there are two threads "Receive thread " and “worker thread” i am creating spans for the operation of the both the threads, i will receive message and forward that to worker thread. But in service graph for the calculation of average it is considering the the time of only “receive thread” span it is not including the "worker thread " span.

In the above image u can see the red and green box , in red it is span of "receive thread " and in green it is “worker thread” but is service graph it is only considering the span of "receive thread ". How can I combine this both the span for the calculation related to service graph ???