OTEL 服务
Quickwit 本地支持 OpenTelemetry 协议 (OTLP),并提供了一个 gRPC 端点来接收来自 OpenTelemetry collector 或直接从应用程序通过 exporter 发送的跨度数据。此端点默认是启用的。
当启用时,Quickwit 将启动 gRPC 服务,准备接收来自 OpenTelemetry collector 的跨度数据。这些跨度数据默认会被索引到 otel-trace-v0_7
索引中,并且如果该索引不存在,它将自动创建。索引文档映射在下一个section中描述。
如果由于任何原因,您想要禁用这个端点,您可以:
- 在启动 Quickwit 时将环境变量
QW_ENABLE_OTLP_ENDPOINT
设置为false
。 - 或者配置节点配置,将索引器设置
enable_otlp_endpoint
设置为false
。
# ... Indexer configuration ...
indexer:
enable_otlp_endpoint: false
在您选择的索引中发送跨度
您可以通过将 gRPC 请求的头部 qw-otel-traces-index
设置为目标索引 ID 来在您选择的索引中发送跨度。
跟踪和跨度数据模型
一个跟踪是一组跨度,表示一个单独的请求。一个跨度表示跟踪内的单个操作。OpenTelemetry 收集器发送跨度,Quickwit 默认将它们索引到 otel-trace-v0_7
索引中,该索引将 OpenTelemetry 的跨度模型映射到 Quickwit 中的索引文档。
跨度模型源自 OpenTelemetry 规范。
下面是 otel-trace-v0_7
索引的文档映射:
version: 0.7
index_id: otel-trace-v0_7
doc_mapping:
mode: strict
field_mappings:
- name: trace_id
type: bytes
input_format: hex
output_format: hex
fast: true
- name: trace_state
type: text
indexed: false
- name: service_name
type: text
tokenizer: raw
fast: true
- name: resource_attributes
type: json
tokenizer: raw
- name: resource_dropped_attributes_count
type: u64
indexed: false
- name: scope_name
type: text
indexed: false
- name: scope_version
type: text
indexed: false
- name: scope_attributes
type: json
indexed: false
- name: scope_dropped_attributes_count
type: u64
indexed: false
- name: span_id
type: bytes
input_format: hex
output_format: hex
- name: span_kind
type: u64
- name: span_name
type: text
tokenizer: raw
fast: true
- name: span_fingerprint
type: text
tokenizer: raw
- name: span_start_timestamp_nanos
type: datetime
input_formats: [unix_timestamp]
output_format: unix_timestamp_nanos
indexed: false
fast: true
fast_precision: milliseconds
- name: span_end_timestamp_nanos
type: datetime
input_formats: [unix_timestamp]
output_format: unix_timestamp_nanos
indexed: false
fast: false
- name: span_duration_millis
type: u64
indexed: false
fast: true
- name: span_attributes
type: json
tokenizer: raw
fast: true
- name: span_dropped_attributes_count
type: u64
indexed: false
- name: span_dropped_events_count
type: u64
indexed: false
- name: span_dropped_links_count
type: u64
indexed: false
- name: span_status
type: json
indexed: true
- name: parent_span_id
type: bytes
input_format: hex
output_format: hex
indexed: false
- name: events
type: array<json>
tokenizer: raw
fast: true
- name: event_names
type: array<text>
tokenizer: default
record: position
stored: false
- name: links
type: array<json>
tokenizer: raw
timestamp_field: span_start_timestamp_nanos
indexing_settings:
commit_timeout_secs: 10
search_settings:
default_search_fields: []
已知限制
在 Quickwit 0.7 当前的分布式跟踪设置中存在一些限制:
- OTLP gRPC 服务不提供高可用性和高持久性,这将在 0.8 版本中修复。
- OTLP HTTP 只支持二进制 Protobuf 编码。OTLP HTTP 使用 JSON 编码尚未计划,但这可以在下一个版本中轻松修复。如果您需要此功能,请提交一个问题。
如果您对新功能感兴趣或发现了其他限制,请在 GitHub 上提交一个问题。