70 lines
2.2 KiB
Plaintext
70 lines
2.2 KiB
Plaintext
[SERVICE]
|
||
Flush 1
|
||
Log_Level info
|
||
Parsers_File parsers.conf
|
||
|
||
# 方便调试 Fluent Bit 自身状态;不要对公网暴露
|
||
HTTP_Server On
|
||
HTTP_Listen 0.0.0.0
|
||
HTTP_Port 2020
|
||
|
||
# 可选:给 Fluent Bit 文件缓冲目录,配合 compose 里的 volume
|
||
storage.path /buffers
|
||
storage.sync normal
|
||
storage.checksum off
|
||
storage.backlog.mem_limit 64M
|
||
|
||
# Python SDK / OpenTelemetry SDK 发到这里:
|
||
# http://vmauth:8427/v1/logs
|
||
# http://vmauth:8427/v1/metrics
|
||
# vmauth 会转发到 fluentbit:4318
|
||
[INPUT]
|
||
Name opentelemetry
|
||
Listen 0.0.0.0
|
||
Port 4318
|
||
|
||
# OTLP/HTTP 通常期望 200;Fluent Bit 默认是 201
|
||
Successful_Response_Code 200
|
||
|
||
# 保持默认行为:/v1/logs -> v1_logs, /v1/metrics -> v1_metrics
|
||
Tag_From_Uri true
|
||
|
||
Buffer_Chunk_Size 1M
|
||
Buffer_Max_Size 10M
|
||
Threaded On
|
||
|
||
# Python SDK 发来的 metrics -> VictoriaMetrics remote_write
|
||
[OUTPUT]
|
||
Name prometheus_remote_write
|
||
Match *
|
||
Host victoriametrics
|
||
Port 8428
|
||
Uri /api/v1/write
|
||
|
||
# 可选公共 label,便于区分来源
|
||
Add_Label otel_pipeline fluent-bit
|
||
Workers 2
|
||
|
||
# Python SDK 发来的 logs -> vlagent -> VictoriaLogs
|
||
[OUTPUT]
|
||
Name opentelemetry
|
||
Match *
|
||
Host vlagent
|
||
Port 9429
|
||
|
||
Logs_Uri /insert/opentelemetry/v1/logs
|
||
|
||
# VictoriaLogs 摄取日志时的字段映射。
|
||
# Python OTel log body 通常能被自动处理;这里保留多个候选字段更稳。
|
||
Header VL-Msg-Field body,Body,message,msg,log,_msg
|
||
|
||
# 只把低基数字段作为 stream fields,避免 path、status_code 这类字段爆炸。
|
||
Header VL-Stream-Fields service.name,service.namespace,service.version,deployment.environment,host.name
|
||
|
||
Compress gzip
|
||
Workers 2
|
||
|
||
[OUTPUT]
|
||
Name stdout
|
||
Match *
|