Docs » Splunk Distribution of the OpenTelemetry Collector の利用開始 » Collector デプロイツールとオプション » ChefでCollectorをデプロイする

ChefでCollectorをデプロイする 🔗

Chef は、物理マシンや仮想マシン上のインフラを管理するために使われる構成管理技術です。Chef は Cookbook を使ってシナリオを定義します。

CookbookはChefの基本的な作業単位で、作業単位に関連するすべての詳細から構成され、Chefインフラストラクチャ上でノードとして構成されたシステムの設定や状態を変更する機能を持ちます。Cookbookは複数のタスクを実行できます。

前提条件 🔗

Chefを使うには以下のリソースが必要です:

Linux 🔗

以下のLinuxディストリビューションとバージョン:

  • Amazon Linux: 2

  • CentOS、Red Hat、Oracle: 7、8、9

  • Debian: 9, 10, 11

  • SUSE: 12, 15 (注: Collector バージョン 0.34.0 以降のみ。Fluentdによるログ収集は現在サポートされていません)。

  • Ubuntu:18.04, 20.04, 22.04

Windows 🔗

以下のWindowsバージョン。すべてのバージョンでPowerShell 3.0以降を使用する必要があります。

  • Windows Server 2019 64 ビット

  • Windows Server 2022 64-bit

注意

Windowsでは、CollectorはWindowsサービスとしてインストールされ、その環境変数はサービススコープで設定されるため、Collectorサービスでのみ使用でき、マシン全体では使用できません。

ChefでCollectorをインストールして使う 🔗

コミュニティの Cookbook のサイトである Chef Supermarket から Chef Cookbook をダウンロードしてください。

Collector をインストールするには、run_listsplunk_otel_collector::default レシピをインクルードし、ノードの run_state に属性を設定します。以下は、必須の splunk_access_token 属性とオプションの属性を設定する方法を示す設定例です:

{
    "splunk-otel-collector": {
        "splunk_access_token": "<SPLUNK_ACCESS_TOKEN>",
        "splunk_realm": "<SPLUNK_REALM>",
    }
}

Linux 対応の属性 🔗

Linuxの場合、Cookbook は以下の表に示す属性を受け入れます:

Name

説明

デフォルト値

collector_version

インストールする Collector パッケージのバージョン(例: 0.25.0 )。バージョンは、Github Releases の前の v を除いたものに対応する必要があります。Linuxでは、このパラメータが指定されていない場合、最新のCollectorバージョンがインストールされることに注意してください。

なし

gomemlimit

Collector バージョン 0.97.0 から splunk_ballast_size_mib に代わります。GO ランタイムのメモリ使用量を制限し、ガベージコレクションを強化して、メモリ不足を防ぎます。詳細については、設定でメモリバラストを更新する方法 を参照してください。

90% of splunk_total_mem_mib

splunk_access_token

リクエストを認証する Splunk アクセストークン。この属性は必須です。

なし

splunk_realm

どのレルムにデータを送信するか、例えば us0。Splunk のインジェスト URL と API URL は、この値によって推測されます。コレクターサービスでは、SPLUNK_REALM 環境変数にこの値が設定されます。この属性は必須です。Splunk レルムを検索するには、レルムについての注意 を参照してください。

なし

splunk_ingest_url

$splunk_realm パラメータによって推測される URL ではなく、明示的に Splunk インジェスト URL を設定します。環境変数 SPLUNK_INGEST_URL には、Collector サービスに対してこの値が設定されます。

https://ingest.${splunk_realm}.signalfx.com

splunk_api_url

$splunk_realm パラメータによって推測される URL ではなく、明示的に Splunk API URL を設定します。環境変数 SPLUNK_API_URL には、Collector サービスに対してこの値が設定されます。

https://api.${splunk_realm}.signalfx.com

splunk_trace_url

$splunk_ingest_url パラメータによって推測される URL ではなく、明示的に Splunk トレースエンドポイント URL を設定します。環境変数 SPLUNK_TRACE_URL には、Collector サービスに対してこの値が設定されます。

${splunk_ingest_url}/v2/trace

splunk_bundle_dir

Smart Agentバンドルディレクトリへのパス。デフォルトのパスはCollectorパッケージによって提供されます。指定したパスをデフォルト値から変更する場合は、ノードの既存のディレクトリにする必要があります。Collectorサービスでは、SPLUNK_BUNDLE_DIR 環境変数にこの値が設定されます。

/usr/lib/splunk-otel-collector/agent-bundle

splunk_collectd_dir

Smart Agent バンドルのcollectd設定ディレクトリへのパス。デフォルトのパスはCollectorパッケージによって提供されます。指定されたパスがデフォルト値から変更される場合、パスはノード上の既存のディレクトリである必要があります。Collectorサービスでは、SPLUNK_COLLECTD_DIR 環境変数にこの値が設定されます。

${splunk_bundle_dir}/run/collectd

splunk_memory_total_mib

Collector に割り当てる MIB の合計メモリ。バラストサイズを自動的に計算します。Collector サービスでは、SPLUNK_MEMORY_TOTAL_MIB 環境変数にこの値が設定されます。

512

splunk_ballast_size_mib

splunk_ballast_size_mib は Collector バージョン 0.97.0 から非推奨です。使用している場合は、設定の更新方法 を参照してください。

"

collector_config_source

Collector 設定 YAML ファイルのソースパス。このファイルはノードの $collector_config_dest パスにコピーされます。サポートされる値のタイプについては、ファイルリソースの ソース属性 を参照してください。デフォルトのソースファイルはCollectorパッケージで提供されます。

/etc/otel/collector/agent_config.yaml

collector_config_dest

ノード上の Collector 構成ファイルの宛先パス。Collectorサービスでは、SPLUNK_CONFIG 環境変数にこの値が設定されます。

/etc/otel/collector/agent_config.yaml

node['splunk_otel_collector']['collector_config']

Collector 設定オブジェクト。このオブジェクトの下にあるものはすべて直接 YAML に変換され、Collector 設定ファイルになります。このオプションを使用すると、collector_config_source の機能が優先されます。

{}

service_user$service_group

Collector サービスのユーザーまたはグループの所有権を設定します。ユーザーまたはグループが存在しない場合は作成されます。

splunk-otel-collector

package_stage

使用する Collector パッケージ・リポジトリステージ。releasebeta 、または test を指定できます。

release

with_fluentd

ログ収集のための Fluentd と依存関係をインストールするか管理するかどうか。Linux では、依存関係には、Linux の機能を有効にするための capng_c、systemd ジャーナルログ収集のための fluent-plugin-systemd、必要なライブラリと開発ツールが含まれます。

false

fluentd_version

インストールする td-agent (Fluentd) パッケージのバージョン

Debian stretch 用の 3.7.1 およびその他すべての Linux ディストロ用の 4.3.1

fluentd_config_source

Fluentd 設定ファイルのソースパス。このファイルはノードの $fluentd_config_dest パスにコピーされます。サポートされている値のタイプについては、ファイルリソースの ソース属性 を参照してください。デフォルトのソースファイルは Collector パッケージによって提供されます。$with_fluentdtrue に設定されている場合のみ適用できます。

/etc/otel/collector/fluentd/fluent.conf

fluentd_config_dest

ノード上の Fluentd 設定ファイルへの宛先パス。$with_fluentdtrue に設定されている場合にのみ適用されます。

/etc/otel/collector/fluentd/fluent.conf

Configure automatic discovery for back-end applications (Linux only) 🔗

You can automatically instrument your back-end applications applications along with the Collector installation using automatic discovery. Automatic discovery removes the need to install and configure OpenTelemetry agents separately. See Discover telemetry sources automatically for more information. The applications to be instrumented on the node need to be started or restarted separately after installation or any configuration changes for automatic discovery to take effect.

次の表はこの Chef Cookbook で設定できる変数を示しています:

Name

説明

デフォルト値

with_auto_instrumentation

Whether to install or manage automatic discovery for back-end applications. When set to true, the splunk-otel-auto-instrumentation deb/rpm package is downloaded and installed from the Collector repository. To learn more, see Automatic discovery and configuration for back-end applications in Linux.

false

with_auto_instrumentation_sdks

The automatic discovery SDKs to install and activate. Note: dotnet is currently only supported for x86_64/amd64.

%w(java nodejs dotnet)

auto_instrumentation_version

Version of the splunk-otel-auto-instrumentation package to install, for example, 0.50.0. The minimum supported version is 0.48 for Java, 0.87.0 for Node.js, and 0.99.0 for .NET.

latest

auto_instrumentation_systemd

Whether to activate and configure the automatic discovery for systemd services only. If set to true, the automatic discovery environment variables are added to /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf.

false

auto_instrumentation_ld_so_preload

By default, the /etc/ld.so.preload file on the node is configured for the /usr/lib/splunk-instrumentation/libsplunk.so shared object library provided by the splunk-otel-auto-instrumentation package and is required for system-wide automatic discovery. Configure this variable to include additional library paths, for example, /path/to/my.library.so.

''

auto_instrumentation_resource_attributes

OpenTelemetryインストルメンテーションリソース属性を設定します。例えば、deployment.environment=prd,my.key=my.valuekey=value ペアのカンマ区切り文字列)。指定されたリソース属性は、ノード上の /etc/splunk/zeroconfig/node.conf 設定ファイル、または systemd インストール方法を使用している場合は /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf に追加されます。

''

auto_instrumentation_service_name

ノード上のすべてのインストルメンテーションされたアプリケーションのサービス名を明示的に設定します(例: my.service )。デフォルトでは、インストルメンテーションされたアプリケーションごとにサービス名が自動的に導出されます。しかし、この変数に空でない値が設定されると、その値は派生したサービス名を上書きします。

''

auto_instrumentation_enable_profiler

AlwaysOn CPU プロファイリングを有効または無効にします。詳細については、AlwaysOn Profilingの Node.js 設定 を参照してください。

false

auto_instrumentation_enable_profiler_memory

AlwaysOn Memory Profiling を有効または無効にします。詳細については、AlwaysOn Profilingの Node.js 設定 を参照してください。

false

auto_instrumentation_enable_metrics

インストルメンテーションメトリクスのエクスポートを有効または無効にします。

false

auto_instrumentation_otlp_endpoint

トレースを受信する OTLP gRPC エンドポイントを設定します。OpenTelemetry Collector バージョン 0.87.0 以降にのみ適用できます。

http://127.0.0.1:4317

auto_instrumentation_java_agent_path

Splunk OpenTelemetry Java エージェントへのパス。デフォルトのパスは splunk-otel-auto-instrumentation パッケージによって提供されます。パスをデフォルト値から変更する場合は、ノード上の既存のファイルである必要があります。

/usr/lib/splunk-instrumentation/splunk-otel-javaagent.jar

auto_instrumentation_npm_path

プリインストールされている npm コマンドへのパス、例: /my/custom/path/to/npm

npm

Configure automatic discovery for SignalFx .NET (Windows only) 🔗

You can automatically instrument your .NET applications along with the Collector installation using automatic discovery. Automatic discovery removes the need to install and configure the SignalFx .NET agent separately. See Discover telemetry sources automatically for more information.

Cookbook は以下の表に示す属性を受け入れます:

Name

説明

デフォルト値

with_signalfx_dotnet_instrumentation

Whether to install or manage automatic discovery for .NET. When set to true, the signalfx-dotnet-tracing MSI package will be downloaded and installed, and the Windows registry will be updated based on other configuration options. To learn more, see Automatic discovery for back-end applications in Windows

false

signalfx_dotnet_auto_instrumentation_version

ダウンロードしてインストールする signalfx-dotnet-tracing MSI パッケージのバージョン。

1.1.0

signalfx_dotnet_auto_instrumentation_msi_url

カスタムホストから MSI をダウンロードする URL を指定します (例: https://my.host/signalfx-dotnet-tracing-1.0.0-x64.msi )。指定した場合、signalfx_dotnet_auto_instrumentation_version オプションは無視されます。

https://github.com/signalfx/signalfx-dotnet-tracing/releases/download/v{{ signalfx_dotnet_auto_instrumentation_version }}/signalfx-dotnet-tracing-{{ signalfx_dotnet_auto_instrumentation_version }}-x64.msi

signalfx_dotnet_auto_instrumentation_iisreset

デフォルトでは、iisreset.exe コマンドがインストール/設定後に実行され、IIS アプリケーションに変更が反映されます。IIS が個別に管理されているか、適用されない場合は、このオプションを false に設定して、この手順をスキップします。

false

signalfx_dotnet_auto_instrumentation_system_wide

Whether to configure automatic discovery for all .NET applications on the node. When set to true, all attributes and environment variables are added to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment registry key.

false

signalfx_dotnet_auto_instrumentation_environment

Splunk APM に報告されるデプロイメント環境変数を設定します (例: production )。この値は Windows レジストリの SIGNALFX_ENV 環境変数に割り当てられます。

''

signalfx_dotnet_auto_instrumentation_service_name

インストルメンテーションされたアプリケーションのサービス名を設定します。例: my-service。この値はWindowsレジストリの SIGNALFX_SERVICE_NAME 環境変数に割り当てられます。

''

signalfx_dotnet_auto_instrumentation_enable_profiler

AlwaysOn Profiling を有効または無効にします。この値は、Windows レジストリの SIGNALFX_PROFILER_ENABLED 環境変数に割り当てられます。

false

signalfx_dotnet_auto_instrumentation_enable_profiler_memory

AlwaysOn Memory Profiling を有効または無効にします。この値は、Windows レジストリの SIGNALFX_PROFILER_MEMORY_ENABLED 環境変数に割り当てられます。

false

signalfx_dotnet_auto_instrumentation_additional_options

上記のオプションに加えて、Windowsレジストリに追加するオプションのハッシュ。詳しくは SignalFx Instrumentation for .NETの設定 を参照してください。

{}

追加の環境変数 🔗

CollectorのサービスにCollector 設定ファイルから追加の環境変数を含めるには、collector_additional_env_vars を使用します。デフォルトでは {} です。

たとえば、Collector の設定ファイルに ${MY_CUSTOM_VAR1}${MY_CUSTOM_VAR2} への参照が含まれている場合、Collector サービスがこれらの変数を展開できるようにするには、次のように指定します:

collector_additional_env_vars: {'MY_CUSTOM_VAR1' => 'value1', 'MY_CUSTOM_VAR2' => 'value2'}

Linuxでは、変数/値は /etc/otel/collector/splunk-otel-collector.conf systemd環境ファイルに追加されます。

Windows では、変数/値は HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\splunk-otel-collector レジストリキーの下の Environment 値に追加されます。

This page was last updated on 2024年05月14日.