OpenTracing provides two functions to propagate the trace context: “extract (format, carrier)” and “inject (SpanContext, format, carrier)”. “extract()” retrieves the tracing context from a carrier, usually it is the HTTP header. “inject” puts the tracing context into a carrier, so the tracing chain won’t break. The following is the diagram for “b3-propagation”, which I took from Zipkin.
通过上面的描述,想要了解在 trace 中抽象的两个方法:inject 和 extract。用来关联整个 trace 链路的操作
In OpenTracing, an important concept is called “trace”, which represents one calling chain of a request from the beginning to the end and the identifier is “traceID”. Under a trace, there are many spans, each captures a unit of work inside the calling chain and it is identified by “spanId”. Each span has one parent and all spans of a trace formed a directed acyclic graph(DAG).
通过上面的描述,主要了解到 trace 和 span 的关系
参考文章: