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

Ansible for LinuxでCollectorをデプロイする 🔗

Ansibleコレクションをインストールする 🔗

以下のLinuxディストリビューションとバージョンがサポートされています:

  • Amazon Linux: 2, 2023。Fluentd によるログ収集は Amazon Linux 2023 ではサポートされていません。

  • CentOS、Red Hat、またはOracle: 7、8、9

  • Debian: 9, 10, 11

  • SUSE: 12, 15 Collector バージョン 0.34.0 以上。Fluentdによるログ収集はサポートされていません。

  • Ubuntu:16.04、18.04、20.04、22.04

Ansibleコレクションをインストールする前に、以下を実行します:

Ansible Galaxyは、Ansibleのコンテンツを共有するためのAnsible公式ハブです。プレイブックの詳細については、Splunk Distribution of OpenTelemetry Collector用のAnsibleコレクション を参照してください。

以下のコマンドを実行して、Ansible GalaxyからAnsibleコレクションをインストールします:

ansible-galaxy collection install signalfx.splunk_otel_collector

このロールを使用するには、プレイブックに signalfx.splunk_otel_collector.collector role 呼び出しを含めます。この役割にはroot権限が必要であることに注意してください。以下の例では、必要最小限の構成を持ってプレイブック内でこのロールを使用する方法を示します:

- name: Install the Splunk Distribution of OpenTelemetry Collector
  hosts: all
  become: yes
  tasks:
    - name: "Include splunk_otel_collector"
      include_role:
        name: "signalfx.splunk_otel_collector.collector"
      vars:
        splunk_access_token: YOUR_ACCESS_TOKEN
        splunk_realm: SPLUNK_REALM

次の表は、このロールに設定できる変数について説明したものです:

変数

説明

gomemlimit

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

splunk_access_token

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

splunk_realm

データを送信するレルム。この変数はサービスに対してこの値が設定されます。デフォルト値は us0 です。Splunk レルムを検索するには、レルムについての注意 を参照してください。

splunk_ingest_url

Splunk インジェスト URL、例えば https://ingest.us0.signalfx.com 。この変数は、サービスに対してこの値が設定されます。デフォルト値は https://ingest.{{ splunk_realm }}.signalfx.com です。

splunk_api_url

Splunk API の URL、たとえば https://api.us0.signalfx.com 。この変数には、サービスのこの値が設定されます。デフォルト値は https://api.{{ splunk_realm }}.signalfx.com です。

splunk_trace_url

Splunk トレースエンドポイント URL、例えば https://ingest.us0.signalfx.com/v2/trace 。この変数は、サービスに対してこの値が設定されます。デフォルト値は {{ splunk_ingest_url }}/v2/trace です。

splunk_hec_url

Splunk HEC のエンドポイント URL、例えば https://ingest.us0.signalfx.com/v1/log 。この変数は、サービスに対してこの値が設定されます。デフォルト値は {{ splunk_ingest_url }}/v1/log です。

splunk_otel_collector_version

インストールするパッケージのバージョン。例えば、0.25.0 。デフォルト値は latest です。

splunk_otel_collector_config

YAML で作成された設定ファイル。この変数を /etc/otel/collector/gateway_config.yaml に設定することで、パッケージをデータ転送 (ゲートウェイ) モードでインストールできます。デフォルトの場所は /etc/otel/collector/agent_config.yaml です。

splunk_config_override

デフォルトのコンフィギュレーションにマージされるカスタムコンフィギュレーション。

splunk_config_override_list_merge

splunk_config_override のリストをデフォルト設定のリストとマージするための list_merge オプションを設定するために使用される変数。指定できるオプションは replacekeepappendprependappend_rp または prepend_rp です。デフォルト値は replace です。この変数に関する情報は、Ansibleドキュメンテーションサイト にあります。

splunk_otel_collector_config_source

これは、リモートホスト上で splunk_otel_collector_config で設定された値の代わりにアップロードされて設定される、コントロールホスト上の設定ファイルへのソースパスです。この変数を使用して、例えば ./custom_collector_config.yaml のようなカスタム設定を送信することができます。デフォルト値は "" で、何もコピーされず、 splunk_otel_collector_config で設定された設定ファイルが使用されます。

splunk_bundle_dir

バンドルディレクトリへのパス。デフォルトのパスはパッケージによって提供されます。指定されたパスがデフォルト値から変更された場合、パスはノード上の既存のディレクトリでなければなりません。この変数はサービスに対してこの値が設定されます。デフォルトの場所は /usr/lib/splunk-otel-collector/agent-bundle です。

splunk_collectd_dir

バンドルの collectd 設定ディレクトリへのパス。デフォルトのパスはパッケージによって提供されます。指定されたパスがデフォルト値から変更された場合、パスはノード上の既存のディレクトリでなければなりません。この変数はサービスに対してこの値が設定されます。デフォルトの場所は /usr/lib/splunk-otel-collector/agent-bundle です。

splunk_service_usersplunk_service_group

サービスのユーザーまたはグループの所有権。ユーザーまたはグループが存在しない場合は作成されます。デフォルト値は splunk-otel-collector です。

splunk_otel_collector_proxy_httpsplunk_otel_collector_proxy_https

http_proxyhttps_proxy 環境変数の少なくとも一方が空でない場合に、 サービスが使用するプロキシアドレス。この値は、例えば http://user:pass@10.0.0.42 のように、完全なURLでなければなりません。このプロキシは、デプロイ時にAnsible自体では使用されないことに注意してください。デフォルト値は "" です。

splunk_memory_total_mib

割り当てられたメモリの量(MiB)。デフォルト値は 512 、つまり 500 x 2^20 バイトのメモリです。

splunk_ballast_size_mib

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

install_fluentd

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

td_agent_version

インストールされている td-agent (Fluentd パッケージ) のバージョン。デフォルト値は、Debian jessie では 3.3.0 、Debian stretch では 3.7.1 、その他のディストロでは 4.3.0 です。

splunk_fluentd_config

リモートホスト上の Fluentd 設定ファイルへのパス。デフォルトの場所は /etc/otel/collector/fluentd/fluent.conf です。

splunk_fluentd_config_source

リモートホストで splunk_fluentd_config で設定された値の代わりにアップロードされて設定される、コントロールホスト上の Fluentd 設定ファイルへのソースパス。この変数を、たとえば ./custom_fluentd_config.conf のように、カスタムの Fluentd 設定を送信するために使います。デフォルト値は "" で、何もコピーされず、splunk_otel_collector_config で設定された設定ファイルが使われます。

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

You can automatically discover and instrument your back-end applications along with the Collector installation. Automatic discovery (formerly zero configuration auto instrumentation) removes the need to install and configure the SDKs separately. See Configure automatic discovery for Java for more information.

次の表は、この Ansible ロールに設定できる変数を示しています:

変数

説明

デフォルト値

install_splunk_otel_auto_instrumentation

Installs or manages automatic discovery for Java, Node.js, and/or .NET back-end applications. When set to true, the splunk-otel-auto-instrumentation Debian or RPM package is downloaded and installed from the Collector repository. The application(s) on the node needs to be started or restarted separately after installation for automatic discovery or any configuration changes to take effect.

false

splunk_otel_auto_instrumentation_sdks

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

['java', 'nodejs', 'dotnet']

splunk_otel_auto_instrumentation_version

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

latest

splunk_otel_auto_instrumentation_systemd

By default, the /etc/ld.so.preload file on the node will be configured for the /usr/lib/splunk-instrumentation/libsplunk.so shared object library provided by the splunk-otel-auto-instrumentation package to activate and configure automatic discovery system-wide for all supported applications. Alternatively, set this option to true to activate and configure automatic discovery only for supported applications running as systemd services. If this option is set to true, /usr/lib/splunk-instrumentation/libsplunk.so will not be added to /etc/ld.so.preload. Instead, the /usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf systemd drop-in file will be created and configured for environment variables based on the default and specified options.

false

splunk_otel_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, which is provided by the splunk-otel-auto-instrumentation package and is required for automatic discovery. You can configure this variable to include additional library paths, for example, /path/to/my.library.so. Use this option if you need to include custom or other shared object library files to be preloaded for your applications, in addition to the /usr/lib/splunk-instrumentation/libsplunk.so file.

なし

splunk_otel_auto_instrumentation_java_agent_jar

Determines the path to the Splunk OpenTelemetry Java agent. The default path is provided by the splunk-otel-auto-instrumentation package. If the path is changed from the default value, the path should be an existing file on the node.

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

splunk_otel_auto_instrumentation_npm_path

The path to the pre-installed npm command required to install the Node.js SDK. For example, /my/custom/path/to/npm.

npm

splunk_otel_auto_instrumentation_resource_attributes

Configures the OpenTelemetry instrumentation resource attributes, for example, deployment.environment=prod. The resource attributes are user-defined comma-separated key=value pairs. See Java, Node.js, and .NET for more information.

なし

splunk_otel_auto_instrumentation_service_name

Explicitly sets the service name for the instrumented applications, for example, my.service. By default, the service name is automatically derived from the arguments of the executable on the node. See Java, Node.js, and .NET for more information.

なし

splunk_otel_auto_instrumentation_enable_profiler

AlwaysOn CPU プロファイリングを有効または無効にします。

false

splunk_otel_auto_instrumentation_enable_profiler_memory

AlwaysOn Memory Profiling を有効または無効にします。

false

splunk_otel_auto_instrumentation_enable_metrics

JVM メトリクスをアクティブまたは非アクティブにします。

false

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