Docs » Splunk Distribution of the OpenTelemetry Collector の利用開始 » Discover telemetry sources automatically » Automatic discovery and configuration for Linux » Automatic discovery and configuration for back-end applications in Linux

Automatic discovery and configuration for back-end applications in Linux 🔗

When using automatic discovery and configuration, the Splunk Distribution of OpenTelemetry Collector automatically detects back-end applications running in your Linux environment.

By deploying the Collector with automatic discovery, you can instrument applications and send data to Splunk Observability Cloud without editing your application’s code or configuring files.

Automatic discovery for Linux can detect and configure the following applications and language runtimes:

  • Java

  • Node.js

  • .NET

How automatic discovery for Linux works 🔗

Automatic discovery for Linux operates as a mode of the Splunk Distribution of OpenTelemetry Collector. You install and activate automatic discovery for the Collector by using the Linux installer script or package manager. During installation, you can specify the types of language runtimes you want the Collector to detect.

After installation, the Collector runs in your Linux environment and listens for requests to your applications. When the Collector detects activity, it gathers telemetry data from your application runtime and sends this data to Splunk Application Performance Monitoring (APM).

要件 🔗

You need the following components to use automatic discovery for back-end Linux applications:

  • systemd

  • curl

  • sudo

Make sure you’ve also installed the components specific to your language runtime:

Java version 8 or higher and supported libraries. See Javaエージェントの互換性と要件 for more information.

はじめに 🔗

To install and use automatic discovery for Linux, follow these steps:

  1. パッケージをインストールする

  2. コレクターサービスが実行されていることを確認します。

  3. Splunk APM で結果を表示する

パッケージをインストールする 🔗

Using the installer script, you can install and activate automatic discovery for either all supported applications on the host via the system-wide method or only for applications running as systemd services.

Using the installer script, you can install the automatic discovery package for Java and activate automatic discovery for Java for either all supported Java applications on the host via the system-wide method or for only Java applications running as systemd services.

注釈

By default, automatic discovery is activated for all languages (Java, Node.js, and .NET) when using the installer script. To deactivate automatic discovery for other languages, add the --without-instrumentation-sdk [language] option in the installer script command.

次の例に示すように、--with-instrumentation オプションを指定してインストーラ・スクリプトを実行します。<SPLUNK_REALM><SPLUNK_ACCESS_TOKEN> をそれぞれ Splunk Observability Cloud レルムとトークンに置き換えてください。

curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh && \
sudo sh /tmp/splunk-otel-collector.sh --with-instrumentation --realm <SPLUNK_REALM> -- <SPLUNK_ACCESS_TOKEN>

注釈

Log Observer 権限を持っているか、ターゲットホストのログを収集したい場合は、--with-fluentd オプションを指定して、Fluentd がCollectorインスタンスにインストールされ、有効になっていることを確認します。

The system-wide automatic discovery method automatically adds environment variables to /etc/splunk/zeroconfig/java.conf.

インストール時にオプションの deployment.environment リソース属性を自動的に定義するには、--deployment-environment <env> オプションを指定してインストーラ・スクリプトを実行します。次の例に示すように、<env> を希望する属性値、例えば prod で置き換えます:

curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh && \
sudo sh /tmp/splunk-otel-collector.sh --with-instrumentation --deployment-environment prod \
--realm <SPLUNK_REALM> -- <SPLUNK_ACCESS_TOKEN>

次の例のように、追加オプションを使用して、CPU とメモリ、およびメトリクスの AlwaysOn Profilingを有効にできます:

curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh && \
sudo sh /tmp/splunk-otel-collector.sh --with-instrumentation --deployment-environment prod \
--realm <SPLUNK_REALM> -- <SPLUNK_ACCESS_TOKEN> \
--enable-profiler --enable-profiler-memory --enable-metrics

Next, ensure the service is running and restart your application. See コレクターサービスが実行されていることを確認します。 and アプリケーションを開始する.

コレクターサービスが実行されていることを確認します。 🔗

インストールに成功したら、以下のコマンドを実行し、splunk-otel-collector サービスが実行されていることを確認します:

sudo systemctl status splunk-otel-collector

サービスが起動していない場合は、以下のコマンドで起動または再起動します:

sudo systemctl restart splunk-otel-collector

サービスが開始できない場合は、/etc/otel/collector/splunk-otel-collector.confSPLUNK_REALMSPLUNK_ACCESS_TOKEN が正しいことを確認します。このコマンドでサービスのログを見ることもできます:

sudo journalctl -u splunk-otel-collector

アプリケーションを開始する 🔗

For automatic discovery to take effect, you must either restart the host or manually start or restart any applications on the host where you installed the package. You must restart the host or applications after installing the automatic discovery package for the first time and whenever you make any changes to the configuration file.

After your applications are running, you can verify your data. See Splunk APM で結果を表示する. You can also configure instrumentation settings. See (オプション)インストルメンテーションの設定.

(オプション)インストルメンテーションの設定 🔗

You can configure the Splunk Distribution of OpenTelemetry Collector to suit your instrumentation needs. In most cases, modifying the basic configuration is enough to get started.

To learn more, see the following resources:

Update automatic discovery and configuration 🔗

You can upgrade the package by using the package repository or by using Debian or RPM packages.

インストーラ・スクリプトを使ってパッケージをインストールした場合、または Debian や RPM のパッケージリポジトリを手動で設定した場合は、プラットフォームに応じて以下のコマンドを実行してください。パッケージのアップグレードには root 権限が必要です。

以下のコマンドを実行します:

sudo apt-get update
sudo apt-get --only-upgrade splunk-otel-auto-instrumentation

You might see a prompt to keep or overwrite the configuration file(s) in /etc/splunk/zeroconfig/. If you choose to overwrite, the configuration file reverts to the default file provided by the upgraded package.

トラブルシューティング 🔗

To troubleshoot common errors that occur when instrumenting applications, see the following troubleshooting guides:

Splunk APM で結果を表示する 🔗

After activating automatic discovery, ensure your data is flowing into Splunk Observability Cloud. See データがSplunk APMに取り込まれていることを確認する.

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