I am new to GCT. For most examples I found online, the start and end of a span are on the same machine (or even the same function like defer span.Close()
). E.g.
try (Scope ss = tracer.spanBuilder("ChildSpan").startScopedSpan()) {
...
}
Meanwhile my system is comprised of many message-driven micro-services with async APIs.
When an ingress micro-service receives a request, it handles it, send a message to a message queue and then return. Some other micro-services would listen to the message queue and continue with the process till the very end (e.g. a final report is generated and stored).
How can I start and end the root span in this case? This might have something to do with the context propagation, but please help with some concrete example codes or APIs to use in order to show how this can be done in Google Cloud Trace. Thanks.