Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

how to tracing the operation between two processes #232

Open
chiaqi opened this issue Oct 30, 2018 · 3 comments
Open

how to tracing the operation between two processes #232

chiaqi opened this issue Oct 30, 2018 · 3 comments

Comments

@chiaqi
Copy link

chiaqi commented Oct 30, 2018

i have such a scene to trace: process_a send data to process_b, I need to track the entire process of sending data until it is accepted by process_b. the two process communicate with share memory.
now create root_span at process_a and sent the Spancontext to process_b, and create child_span with root_span's SpanContext .but this still can't track the process of delivery. i want to end the root_span in process_b, but how to do this?

Anyone knows the solution to solve this problems, thank you!!

@billowqiu
Copy link

既然是process_a创建的root_span,为啥不是自己finish呢?

@bogdandrutu
Copy link

@chiaqi we do not encourage this behavior of sharing spans between process, and we suggest to have 2 different spans:

  1. Process_A starts a root spans and end the span when the RPC/HTTP call is finished (in your case when the message is added in the shared memory if there is no way to wait for the message to be delivered to Process_B).
  2. Process_B start a child span (child of the root span created in Process_A and propagated via the shared memory using the SpanContext). This Span can start when Process_B sees the message and ended when Process_B finishes to process the received message (similar with an RPC).

You can see the "delivery" time as the difference root_span.start_time - child_span.start_time.

Does this answer your question, let me know if this does not work and I can try to help more.

@chiaqi
Copy link
Author

chiaqi commented Oct 31, 2018

@bogdandrutu thanks for your answer
I can see the delivery time , but how to intuitively display it on the stackdriver?
Is there a better solution for this scenario?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants