首页/云/可观测性速查/Collector 配置文件示例
本包目录(282 条)

Collector 配置文件示例

一份可读的 Collector 配置:OTLP 接收(gRPC 4317 / HTTP 4318)、内存保护与批处理、转发到后端;service 段声明 traces 管道。

可观测性速查云更新于 2026-10-12

config.yaml

config.yaml
receivers:
  otlp:
    protocols:
      grpc: { endpoint: 0.0.0.0:4317 }
      http: { endpoint: 0.0.0.0:4318 }

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 25
  batch: {}

exporters:
  otlp/tempo:
    endpoint: tempo:4317
    tls: { insecure: true }

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [otlp/tempo]
本地校验:otelcol validate --config=config.yaml;改完配置先校验再滚动重启。

易错点

  • memory_limiter 的 limit 必须低于容器内存上限,超限会被 OOM 杀而不是优雅拒绝
  • exporters 名称带斜杠(otlp/tempo)是命名空间写法,引用时要带全名

数据来源与参考

  • OpenTelemetry Collector · Configuration
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌