151 lines
3.0 KiB
YAML
151 lines
3.0 KiB
YAML
# OpenTelemetry Collector 配置
|
||
# 收集应用的 traces, metrics, logs 并转发到后端
|
||
|
||
mode: deployment
|
||
|
||
# 镜像配置
|
||
image:
|
||
repository: otel/opentelemetry-collector-k8s
|
||
tag: "" # 使用默认 tag
|
||
|
||
# 副本数(单节点环境使用 1 个副本)
|
||
replicaCount: 1
|
||
|
||
# 资源限制
|
||
resources:
|
||
requests:
|
||
cpu: 100m
|
||
memory: 128Mi
|
||
limits:
|
||
cpu: 500m
|
||
memory: 512Mi
|
||
|
||
# Service 配置
|
||
service:
|
||
type: ClusterIP
|
||
|
||
# Ports 配置(仅配置必要端口)
|
||
ports:
|
||
otlp:
|
||
enabled: true
|
||
containerPort: 4317
|
||
servicePort: 4317
|
||
protocol: TCP
|
||
appProtocol: grpc
|
||
otlp-http:
|
||
enabled: true
|
||
containerPort: 4318
|
||
servicePort: 4318
|
||
protocol: TCP
|
||
jaeger-grpc:
|
||
enabled: true
|
||
containerPort: 14250
|
||
servicePort: 14250
|
||
protocol: TCP
|
||
zipkin:
|
||
enabled: true
|
||
containerPort: 9411
|
||
servicePort: 9411
|
||
protocol: TCP
|
||
prometheus:
|
||
enabled: true
|
||
containerPort: 8888
|
||
servicePort: 8888
|
||
protocol: TCP
|
||
|
||
# OpenTelemetry Collector 配置
|
||
config:
|
||
receivers:
|
||
# OTLP receivers(推荐使用)
|
||
otlp:
|
||
protocols:
|
||
grpc:
|
||
endpoint: 0.0.0.0:4317
|
||
http:
|
||
endpoint: 0.0.0.0:4318
|
||
|
||
# Jaeger receivers(向后兼容)
|
||
jaeger:
|
||
protocols:
|
||
grpc:
|
||
endpoint: 0.0.0.0:14250
|
||
thrift_http:
|
||
endpoint: 0.0.0.0:14268
|
||
|
||
# Zipkin receiver(向后兼容)
|
||
zipkin:
|
||
endpoint: 0.0.0.0:9411
|
||
|
||
processors:
|
||
# Batch processor(批量处理,提高性能)
|
||
batch:
|
||
timeout: 10s
|
||
send_batch_size: 1024
|
||
|
||
# Memory limiter(防止 OOM)
|
||
memory_limiter:
|
||
check_interval: 1s
|
||
limit_percentage: 75
|
||
spike_limit_percentage: 25
|
||
|
||
# Resource processor(添加资源属性)
|
||
resource:
|
||
attributes:
|
||
- key: cluster.name
|
||
value: orbstack-k8s
|
||
action: upsert
|
||
- key: environment
|
||
value: development
|
||
action: upsert
|
||
|
||
# Attributes processor(处理 span 属性)
|
||
attributes:
|
||
actions:
|
||
- key: http.user_agent
|
||
action: delete
|
||
- key: net.peer.ip
|
||
action: delete
|
||
|
||
exporters:
|
||
# OTLP exporter to Tempo
|
||
otlp/tempo:
|
||
endpoint: tempo.tracing.svc.cluster.local:4317
|
||
tls:
|
||
insecure: true
|
||
|
||
# Logging exporter(调试用)
|
||
debug:
|
||
verbosity: detailed
|
||
sampling_initial: 5
|
||
sampling_thereafter: 200
|
||
|
||
extensions:
|
||
# Health check
|
||
health_check:
|
||
endpoint: 0.0.0.0:13133
|
||
|
||
# pprof for debugging
|
||
pprof:
|
||
endpoint: 0.0.0.0:1777
|
||
|
||
# zpages for debugging
|
||
zpages:
|
||
endpoint: 0.0.0.0:55679
|
||
|
||
service:
|
||
extensions: [health_check, pprof, zpages]
|
||
pipelines:
|
||
# Traces pipeline
|
||
traces:
|
||
receivers: [otlp, jaeger, zipkin]
|
||
processors: [memory_limiter, batch, resource, attributes]
|
||
exporters: [otlp/tempo, debug]
|
||
|
||
# Service Monitor(Prometheus 监控)
|
||
serviceMonitor:
|
||
enabled: false
|
||
|
||
# Pod Disruption Budget
|
||
podDisruptionBudget:
|
||
enabled: false
|