Status

Current state[One of "Under Discussion", "Accepted", "Rejected"]

Discussion thread: https://lists.apache.org/thread/mvcfhj12hpk00ov1rhkw1k5d811jk8pj

JIRA or Github Issue: 

Released: <Doris Version>

Google Doc: <If the design in question is unclear or needs to be discussed and reviewed, a Google Doc can be used first to facilitate comments from others.>

Motivation

  1. Telemetry data traces, metrics, and logs are often known as the three pillars of observability. Currently, Doris lacks traces telemetry data collection, which makes it difficult to locate slow queries and troubleshoot system bottlenecks. With OpenTelemetry, traces data can be collected to effectively monitor the process of request execution and greatly improve system observability.
  2. Doris currently does not implement a uniform open standard for telemetry data collection, which is not conducive to exporting telemetry data to third-party systems for analysis. OpenTelemetry implements a set of open source standard semantic conventions, provides vendor-independent instrumentation libraries, and supports multiple programming languages for telemetry data collection and easy export of telemetry data to different back-end nodes (including Zipkin, Jaeger, Prometheus, etc.).
  3. The telemetry data currently collected by Doris is not correlated with each other, and it is impossible to quickly locate one kind of telemetry data to another. By introducing OpenTelemetry, traces, metrics, logs can be correlated. For example, we can inject traceid and spanid into metrics through exemplars to correlate traces and metrics, and inject traceid and spanid into logs to correlate traces and logs, so as to quickly locate all telemetry data of the problem.

Related Research

1. Telemetry

Telemetry refers to data emitted from a system, about its behavior. The data can come in the form of Traces, Metrics, and Logs.

2. OpenTelemetry architecture

3. What traces can do

4. traces storage

opentelemetry is responsible for the collection, processing and export of telemetry data, and Back-end is responsible for the presentation and storage of telemetry data. traces-related Back-end such as zipkin supports storage components: memory, Elasticsearch, MySQL, etc., and even doris can be used as its storage component.
This means that if trace data is stored in doris, that is, it allows users to have some trace analysis capability without deploying collector and back-end, and also to get full trace analysis processing capability after deploying collector and back-end.

The following diagram shows the export and storage process of trace, with arrows indicating the direction of trace data flow. trace can be collected and stored directly by doris, or by exporting trace to collector for processing and then storing it in doris, and back-end pulling data directly from doris.

┌──────────────────────────┐
│                          │
│  doris                   │
│                          │
│  ┌───────────────────┐   │           ┌───────────────────┐
│  │                   │   │           │                   │
│  │                   │   │           │                   │
│  │ trace collection  ├───┼───────────►  otel collector   │
│  │                   │   │           │                   │
│  │                   │   │           │                   │
│  └─────┬─────────────┘   │           └─────────┬─────────┘
│        │                 │                     │
│        │      ┌──────────┼─────────────────────┘
│        │      │          │
│        │      │          │
│  ┌─────▼──────▼──────┐   │           ┌───────────────────┐
│  │                   │   │           │                   │
│  │                   │   │           │                   │
│  │ trace storage     ├───┼───────────►    back-end       │
│  │                   │   │           │                   │
│  │                   │   │           │                   │
│  └───────────────────┘   │           └───────────────────┘
│                          │
│                          │
└──────────────────────────┘

Detailed Design

Query trace collection and export:

1-creating trace


2-collecting span of fe


3-collecting span of be


4-propagating trace between fe and be


5-exporting span


Scheduling

specific implementation steps and approximate scheduling.