Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Query trace collection and export:

1-creating trace

trace is only created by fe, and when fe receives a sql request, it creates the root span and initializes the traceId in the processOnce method of the ConnectProcessor class. if fe does not have tracing enabled, be does not create traces either.

2-collecting span of fe


3-

...

4-propagating trace between fe and be

...

propagating trace between fe and be

When fe launches an rpc to be, it creates a span of type client and injects the context of the span into the rpc. be parses the span context after receiving the rpc and creates a span of type server with the span as the parent span. trace propagation across processes is done in this way. By comparing the time of these two spans, we can get the network time consumed by the rpc call.

4-collecting span of be

be creates span when receiving the rpc, executing the fragment, and buries the collection of span in the open, get_next, and close methods of all ExecNode. Since the get_next method of each ExecNode is called multiple times, to create too many unnecessary spans, the get_next method of the same ExecNode only creates a get_next_span the first time it is called, and ends the get_next_span after the last call. A span is also created in the scanner thread started by ScanNode to record the duration of the scan thread. In addition, much of the counter information in the profile is added to the span in the form of Attribute.

5-exporting span

Exporting span is divided into 3 stages:
  a. Support exporting span to back-end directly, such as zipkin.
  b. Introduce otel collector, support exporting span to otel collector.
  c. Support exporting span to doris.

Scheduling

specific implementation steps and approximate scheduling.