简体中文
Appearance
简体中文
Appearance
Datalayers 支持 InfluxDB Line Protocol,因此可以通过 OpenTelemetry Collector 的 InfluxDB Exporter 将指标、链路等观测数据写入 Datalayers。该方案适用于统一接入 OpenTelemetry 采集链路,并将数据存入 Datalayers 进行后续分析和存储。

OpenTelemetry Collector 官方提供 Core 和 Contrib 两个版本。Core 仅包含基础插件,Contrib 包含更完整的插件集。由于 Core 不包含 influxdb exporter,而 Contrib 包含该插件,因此接入 Datalayers 时通常优先选择 Contrib 版本。
如果需要更精简的生产镜像,也可以按需自定义构建 Collector,仅保留必要插件。参考:Building a custom collector
InfluxDB Exporter 详细文档参考:influxdb-exporter
The following configuration options are supported:
endpoint (required) HTTP/S destination for line protocol timeout (default = 5s) Timeout for requestsheaders: (optional) additional headers attached to each HTTP request User-Agent is OpenTelemetry -> Influx by defaulttoken (below) is set, then header Authorization will overridden with the given tokenorg (required) Name of InfluxDB organization that owns the destination bucketbucket (required) name of InfluxDB bucket to which signals will be writtentoken (optional) The authentication token for InfluxDBv1_compatibility (optional) Options for exporting to InfluxDB v1.x enabled (optional) Use InfluxDB v1.x API if enableddb (required if enabled) Name of the InfluxDB database to which signals will be writtenusername (optional) Basic auth username for authenticating with InfluxDB v1.xpassword (optional) Basic auth password for authenticating with InfluxDB v1.xspan_dimensions (default = service.name, span.name) Span attributes to use as dimensions (InfluxDB tags)log_record_dimensions (default = service.name) Log Record attributes to use as dimensions (InfluxDB tags)payload_max_lines (default = 10_000) Maximum number of lines allowed per HTTP POST requestpayload_max_bytes (default = 10_000_000) Maximum number of bytes allowed per HTTP POST requestmetrics_schema (default = telegraf-prometheus-v1) The chosen metrics schema to write; must be one of: telegraf-prometheus-v1telegraf-prometheus-v2sending_queue details hereenabled (default = true)num_consumers (default = 10) The number of consumers from the queuequeue_size (default = 1000) Maximum number of batches allowed in queue at a given timeretry_on_failure details hereenabled (default = true)initial_interval (default = 5s) Time to wait after the first failure before retryingmax_interval (default = 30s) Upper bound on backoff intervalmax_elapsed_time (default = 120s) Maximum amount of time (including retries) spent trying to send a request/batch详见 influxdb-exporter configuration。
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
influxdb:
endpoint: http://172.31.104.77:8361
v1_compatibility:
enabled: true
db: demo
username: admin
password: public
service:
extensions: []
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [influxdb]endpoint 需要替换为实际的 Datalayers HTTP 地址v1_compatibility.enabled=truereceivers 接收的数据会先经过 processors,再发送到 exporters,最终写入 Datalayers