Link documents
https://opentelemetry.io/docs/collector/installation/
https://github.com/open-telemetry/opentelemetry-collector-releases
Enable proxy server nếu có
cat > ~/proxy << 'OEF'
export {http,https}_proxy=http://10.237.7.250:3128
OEF
source ~/proxy
Manual Linux installation
sub_folder='new'
mkdir /opt/observiq-otel-collector-${sub_folder}
cd /opt/observiq-otel-collector-${sub_folder}
curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.117.0/otelcol-contrib_0.117.0_linux_amd64.tar.gz
tar -xvf otelcol-contrib_0.117.0_linux_amd64.tar.gz
unset {http,https}
Check version
shell> /opt/observiq-otel-collector-new# ./otelcol-contrib --version
otelcol-contrib version 0.95.0
Sử dụng lệnh sau để chạy Collector với file cấu hình bạn vừa tạo:
/opt/observiq-otel-collector-new/otelcol-contrib --config /opt/observiq-otel-collector-new/config.yaml
Tạo file /etc/systemd/system/otel-collector.service
cat > /etc/systemd/system/otel-collector.service << 'OEF'
[Unit]
Description=OpenTelemetry Collector
After=network.target
[Service]
Type=simple
ExecStart=/opt/observiq-otel-collector-new/otelcol-contrib --config /opt/observiq-otel-collector-new/config.yaml
Restart=always
[Install]
WantedBy=multi-user.target
OEF
Cập nhật dịch vụ.
systemctl daemon-reload
systemctl enable otel-collector
systemctl restart otel-collector
Kiểm tra trạng thái:
systemctl status otel-collector
Debug command
journalctl -u otel-collector -f -n 100