Skip to main content

OTEL 服务

Quickwit 原生支持 OpenTelemetry 协议 (OTLP),并提供了一个 gRPC 端点来接收来自 OpenTelemetry 收集器的跨度。此端点默认启用。

当启用时,Quickwit 将启动 gRPC 服务,准备接收来自 OpenTelemetry 收集器的日志。日志默认被索引在 otel-logs-v0_7 索引中,如果不存在此索引,则会自动创建。索引的文档映射在下一个 章节 中描述。

如果出于任何原因,您想要禁用此端点,您可以:

  • 在启动 Quickwit 时将环境变量 QW_ENABLE_OTLP_ENDPOINT 设置为 false
  • 或者 配置节点配置,将索引器设置 enable_otlp_endpoint 设置为 false
# ... Indexer configuration ...
indexer:
enable_otlp_endpoint: false

在您自己的索引中发送日志

您可以通过将 gRPC 请求的头 qw-otel-logs-index 设置为目标索引 ID 来将日志发送到您选择的索引中。

OpenTelemetry 日志数据模型

Quickwit 默认将 OpenTelemetry 日志发送到 otel-logs-v0_7 索引中,如果您启用了 OpenTelemetry 服务,此索引将自动创建。 下面描述的此索引的文档映射来源于 OpenTelemetry 日志数据模型


version: 0.7

index_id: otel-logs-v0_7

doc_mapping:
mode: strict
field_mappings:
- name: timestamp_nanos
type: datetime
input_formats: [unix_timestamp]
output_format: unix_timestamp_nanos
indexed: false
fast: true
fast_precision: milliseconds
- name: observed_timestamp_nanos
type: datetime
input_formats: [unix_timestamp]
output_format: unix_timestamp_nanos
- name: service_name
type: text
tokenizer: raw
fast: true
- name: severity_text
type: text
tokenizer: raw
fast: true
- name: severity_number
type: u64
fast: true
- name: body
type: json
tokenizer: default
- name: attributes
type: json
tokenizer: raw
fast: true
- name: dropped_attributes_count
type: u64
indexed: false
- name: trace_id
type: bytes
input_format: hex
output_format: hex
- name: span_id
type: bytes
input_format: hex
output_format: hex
- name: trace_flags
type: u64
indexed: false
- name: resource_attributes
type: json
tokenizer: raw
fast: true
- 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

timestamp_field: timestamp_nanos

indexing_settings:
commit_timeout_secs: 10

search_settings:
default_search_fields: [body.message]

UI 集成

目前,Quickwit 提供了一个简化的 UI 来获取集群、索引和搜索文档的基本信息。 如果简单的 UI 对您来说不够用并且您需要更多功能,Grafana 和 Elasticsearch 查询 API 支持计划于 2023 年第二季度推出,请持续关注!

您也可以将追踪数据发送到 Quickwit,在 Jaeger UI 中查看,具体步骤请参阅以下 教程

已知限制

在 Quickwit 0.7 中的日志管理设置存在一些限制:

  • 摄入 API 不提供高可用性和高持久性,这将在 0.8 版本中修复。
  • OTLP HTTP 只支持二进制 Protobuf 编码。OTLP HTTP 使用 JSON 编码尚未计划,但这可以在下一个版本中轻松解决。如果您需要此功能,请提交一个 Issue。

如果您对新功能感兴趣或发现了其他限制,请在 GitHub 上提交一个 Issue。