tracing
doris is responsible for collecting traces and exporting them to a third-party tracing analysis system, which is responsible for the presentation and storage of traces.
doris currently supports exporting traces directly to zipkin.
Configuring and starting Doris
Add configuration to fe.conf
# Configure traces to export to zipkin
trace_export_url = http://127.0.0.1:9411/api/v2/spans
Add configuration to be.conf
enable_tracing = true
# Configure traces to export to zipkin
trace_export_url = http://127.0.0.1:9411/api/v2/spans
# Queue size for caching spans. span export will be triggered once when the number of spans reaches half of the queue capacity. spans arriving in the queue will be discarded when the queue is full.
# The maximum number of spans to export in a single pass.
max_span_export_batch_size=512
# Maximum interval for exporting span
export_span_schedule_delay_millis=500
Start fe and be
sh fe/bin/start_fe.sh --daemon
sh be/bin/start_be.sh --daemon
View zipkin UI
Use the opentelemetry collector to export traces to other systems such as zipkin, jaeger, skywalking, or to database systems and files. For more details, refer to .
Meanwhile, opentelemetry collector provides a rich set of operators to process traces. For example, filterprocessor , . For more details, refer to collector processor.
opentelemetry has released collector core and , contrib provides richer features, here is an example of contrib version.
Download collector
Download otelcol-contrib, available on the official website
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.55.0/otelcol-contrib_0.55.0_linux_amd64.tar.gz
tar -zxvf otelcol-contrib_0.55.0_linux_amd64.tar.gz
Generate configuration file
The following configuration file uses the otlp (OpenTelemetry Protocol) protocol to receive traces data, perform batch processing and filter out traces longer than 50ms, and finally export them to zipkin and file.
cat > otel-collector-config.yaml << EOF
receivers:
otlp:
protocols:
http:
exporters:
zipkin:
endpoint: "http://10.81.85.90:8791/api/v2/spans"
file:
path: ./filename.json
processors:
batch:
tail_sampling:
policies:
{
name: duration_policy,
type: latency,
}
extensions:
pipelines:
traces:
receivers: [otlp]
processors: [batch, tail_sampling]
exporters: [zipkin, file]
EOF
Start collector
nohup ./otelcol-contrib --config=otel-collector-config.yaml &
Configuring and starting Doris
Add configuration to fe.conf
Add configuration to be.conf
enable_tracing = true
# enable opentelemetry collector
trace_exporter = collector
# Configure traces export to collector, 4318 is the default port for collector otlp http
trace_export_url = http://127.0.0.1:4318/v1/traces
# Queue size for caching spans. span export will be triggered once when the number of spans reaches half of the queue capacity. spans arriving in the queue will be discarded when the queue is full.
max_span_queue_size=2048
# The maximum number of spans to export in a single pass.
max_span_export_batch_size=512
# Maximum interval for exporting span
export_span_schedule_delay_millis=500
Start fe and be
sh fe/bin/start_fe.sh --daemon
sh be/bin/start_be.sh --daemon