Splunk4Ninjas Workshops

OpenTelemetry Collector のデプロイ

10 minutes

OpenTelemetry Collector のアンインストール

EC2 インスタンスには、古いバージョンの Splunk Distribution of the OpenTelemetry Collector がすでにインストールされている場合があります。先に進む前に、以下のコマンドを使用してアンインストールしましょう

bash
curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh;
sudo sh /tmp/splunk-otel-collector.sh --uninstall

OpenTelemetry Collector のデプロイ

Linux EC2 インスタンスに最新バージョンの Splunk Distribution of the OpenTelemetry Collector をデプロイしましょう。

curl を使用して Collector バイナリをダウンロードし、データを送信する Realm、使用するアクセストークン、レポート先のデプロイメント環境を指定する引数を付けて実行します。

Splunk Observability Cloud におけるデプロイメント環境とは、同じアプリケーションの他のデプロイメントの設定と重複しない設定を構成できる、システムまたはアプリケーションの個別のデプロイメントです。

bash
curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh; \
sudo sh /tmp/splunk-otel-collector.sh \
--realm $REALM \
--mode agent \
--without-instrumentation \
--deployment-environment otel-$INSTANCE \
-- $ACCESS_TOKEN

Collector のインストールの詳細については、Install the Collector for Linux with the installer script を参照してください。

Collector の動作確認

インスタンス上で Collector が正常に動作していることを確認しましょう。

Ctrl + C を押してステータスコマンドを終了します。

bash
sudo systemctl status splunk-otel-collector

Collector のログを確認するには?

journalctl を使用して Collector のログを確認できます

Ctrl + C を押してログのテーリングを終了します。

bash
sudo journalctl -u splunk-otel-collector -f -n 100

Collector の設定

この Collector が使用する設定ファイルはどこにあるのでしょうか?

/etc/otel/collector ディレクトリにあります。Collector を agent モードでインストールしたため、Collector の設定は agent_config.yaml ファイルに記載されています。

Last Modified ·