Linuxにコレクターをインストールする

Linux

すべてのコレクターのリリースには、Linux amd64/arm64/i386システム用のAPK、DEB、RPMパッケージが含まれています。 インストール後のデフォルト設定は /etc/otelcol/config.yaml にあります。

Note: サービスの自動設定には systemd が必要です。

DEBのインストール

Debian系のシステムで使い始めるには、以下のコマンドを実行します。

sudo apt-get update
sudo apt-get -y install wget
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_amd64.deb
sudo dpkg -i otelcol_0.135.0_linux_amd64.deb
sudo apt-get update
sudo apt-get -y install wget
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_arm64.deb
sudo dpkg -i otelcol_0.135.0_linux_arm64.deb
sudo apt-get update
sudo apt-get -y install wget systemctl
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_386.deb
sudo dpkg -i otelcol_0.135.0_linux_386.deb

RPMのインストール

Red Hat系のシステムで使い始めるには、以下のコマンドを実行します。

sudo yum update
sudo yum -y install wget systemctl
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_amd64.rpm
sudo rpm -ivh otelcol_0.135.0_linux_amd64.rpm
sudo yum update
sudo yum -y install wget systemctl
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_arm64.rpm
sudo rpm -ivh otelcol_0.135.0_linux_arm64.rpm
sudo yum update
sudo yum -y install wget systemctl
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_386.rpm
sudo rpm -ivh otelcol_0.135.0_linux_386.rpm

手動でのLinuxへのインストール

Linux向けのリリースは、さまざまなアーキテクチャに対応しています。 バイナリを含むファイルをダウンロードし、あなたのマシンに手動でインストールしてください。

curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_amd64.tar.gz
tar -xvf otelcol_0.135.0_linux_amd64.tar.gz
curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_arm64.tar.gz
tar -xvf otelcol_0.135.0_linux_arm64.tar.gz
curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_386.tar.gz
tar -xvf otelcol_0.135.0_linux_386.tar.gz
curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.135.0/otelcol_0.135.0_linux_ppc64le.tar.gz
tar -xvf otelcol_0.135.0_linux_ppc64le.tar.gz

自動サービスコンフィギュレーション

デフォルトでは、otelcol systemd サービスはインストール後に --config=/etc/otelcol/config.yaml オプションをつけて起動します。

別の設定を使うには、/etc/otelcol/otelcol.conf systemd 環境ファイルにある OTELCOL_OPTIONS 変数を適切なコマンドラインオプションに設定します。 /usr/bin/otelcol --help を実行すると、利用可能なすべてのオプションを確認できます。 このファイルに追加の環境変数を追加して otelcol サービスに渡せます。

コレクターの設定ファイルまたは /etc/otelcol/otelcol.conf を変更した場合は、otelcol サービスを再起動して変更を適用します。

sudo systemctl restart otelcol

otelcol サービスからの出力をチェックするには、以下を実行します。

sudo journalctl -u otelcol