收集组件搭建
Collector
- Docker
#!/bin/bash
file_path=`readlink -f $0`
dir_path=`dirname $file_path`
version=0.87.0
# !! 请注意,0.87.0版本已不再支持Jaeger格式导出
sudo docker run \
-v $dir_path/config.yaml:/etc/otelcol-contrib/config.yaml \
-p 1888:1888 \
-p 8888:8888 \
-p 8889:8889 \
-p 13133:13133 \
-p 4317:4317 \
-p 4318:4318 \
-p 55679:55679 \
otel/opentelemetry-collector-contrib:$version
# 1888:pprof extension
# 8888:Prometheus metrics exposed by the collector
# 8889:Prometheus exporter metrics
# 13133:health_check extension
# 4317:OTLP gRPC receiver
# 4318:OTLP http receiver
# 55679:zpages extension
- 使用K8s搭建参考:https://raw.githubusercontent.com/open-telemetry/opentelemetry-collector/main/examples/k8s/otel-config.yaml
- config.yaml 配置
receivers:
otlp: # the OTLP receiver the app is sending traces to
protocols:
http:
processors:
memory_limiter:
check_interval: 1s
limit_mib: 2000
batch:
exporters:
logging:
loglevel: debug
prometheusremotewrite: # the PRW exporter, to ingest metrics to backend
endpoint: http://1.220.68.72:9201/api/v1/write
elasticsearch/trace:
endpoints: [http://elk.example.com:9200]
traces_index: trace_index
api_key: *******==
tls:
insecure: true
otlp/elastic:
endpoint: "fleet-otel-server.example.com:8200"
headers:
Authorization: "Bearer ********"
service:
pipelines:
traces/dev:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [logging, otlp/elastic]
metrics/dev:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [logging, otlp/elastic]
logs/dev:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [logging, otlp/elastic]
本文标题:链路跟踪与观测:OpenTelemetry 组件搭建
本文连接:https://blog.dextercai.com/archives/207.html
除另行说明,本站文字内容采用创作共用版权 CC-BY-NC-ND 4.0 许可协议,版权归本人所有。
除另行说明,本站图片内容版权归本人所有,任何形式的使用需提前联系。