You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 21, 2025. It is now read-only.
Kelvin Jin edited this page Oct 3, 2018
·
1 revision
Spans
Each request in your Node server is represented as a trace, which are composed of one root span and zero or more child spans. The root span measures the latency of the request as a whole, while child spans measure outgoing RPCs done on behalf of a request. In other words:
Root spans
start when your server's request handler is first invoked.
end when you end the response stream (via res.end or similar).
Child spans
start when you call an asynchronous function.
end when the callback provided to that asynchronous function is invoked.
Context Propagation across Asynchronous Boundaries
A difficulty in representing spans as written above is that child spans always have a parent root span, but sometimes, when a child span is started, the parent is unknown. In other words, there is no generically applicable way for automatic instrumentation to know on behalf of which request an outgoing RPC is being performed.