コールグラフ プロファイリングへのデータの取得
Splunk APM のコールグラフ プロファイリングにプロファイリングデータを取り込む方法を学習します。
コールグラフ プロファイリングにデータを取得するための次の高度な手順を完了します。
- 前提条件を満たしていることを確認します。
- アプリケーションをインストゥルメンテーションする
- コールグラフ プロファイリングの有効化
- ゲートウェイデプロイメントを使用している場合は、「ゲートウェイデプロイメントでコールグラフ プロファイリングを有効化する」の手順に従います。
前提条件
Splunk APM のコールグラフ プロファイリングにデータを取り込むための前提条件について説明します。
-
Splunk Observability Cloud の組織で Splunk APM が有効化されていること。手順については、「Splunk APM のセットアップ」を参照してください。
-
Splunk Observability Cloud 組織には、AlwaysOn Profilingのライセンスがあります。
-
Splunk Distribution of OpenTelemetry Collector バージョン 0.44.0 以降が実行されています。手順については、「Splunk Distribution of the OpenTelemetry Collector の利用開始」を参照してください。Collector のバージョンが 0.44.0 より前の場合は、「OpenTelemetry Collector の設定を確認する」を参照してください。
Helm チャートを展開するための追加の前提条件
--set splunkObservability.profilingEnabled='true'values.yaml ファイル自体でパラメータを編集することもできます。例:# This option enables only the shared pipeline for logs and profiling data.
# There is no active collection of profiling data.
# Instrumentation libraries must be configured to send it to the collector.
# If you don't use Call Graph Profiling for Splunk APM, you can disable it.
profilingEnabled: falseprofileEnabled を true に設定すると、コールグラフ プロファイリングに必要なログパイプラインが作成されますが、APM のインストゥルメンテーションはインストールされません。インストゥルメントをインストールするには、次のセクションを参照してください。logsEnabled: falseInstrument your application
Learn how to instrument your application for Call Graph Profiling in Splunk APM.
| Language | Available instrumentation | Documentation |
|---|---|---|
| Java | Splunk Distribution of OpenTelemetry Java version 2.15.0 or higher |
|
For information on data retention, see Data retention in Application Performance Monitoring (APM).
コールグラフ プロファイリングの有効化
Splunk APM でコールグラフ プロファイリングをアクティブ化する方法について説明します。
Splunk Observability Cloud のアプリケーションをインストゥルメント化したら、Java エージェントでコールグラフ プロファイリングを有効にします。
- 次に示すように、
splunk.snapshot.profiler.enabledシステムプロパティをtrueに設定します。java -javaagent:./splunk-otel-javaagent.jar \ -Dsplunk.snapshot.profiler.enabled=true \ -Dotel.exporter.otlp.endpoint=http(s)://collector:4317 \ -jar <your_application>.jarSPLUNK_SNAPSHOT_PROFILE_ENABLED環境変数を使用して、コールグラフ プロファイリングを有効にすることもできます。環境変数の使用の詳細については、「コールグラフ プロファイリングの Java 設定」を参照してください。 プロファイリングデータをエクスポートするOTLPエンドポイントが正しく設定されていることを確認します:
-
プロファイリング固有のエンドポイントは、
splunk.profiler.logs-endpointシステムプロパティまたはSPLUNK_PROFILER_LOGS_ENDPOINT環境変数で設定します。-
このエンドポイントが設定されていない場合、汎用のOTLPエンドポイントが使用され、
otel.exporter.otlp.endpointシステムプロパティまたはOTEL_EXPORTER_OTLP_ENDPOINT環境変数によって設定されます。 -
このエンドポイントも設定されていない場合は、デフォルトの
http://localhost:4317になります。
-
-
Kubernetes 以外の展開の場合、OTLP エンドポイントは
http://${COLLECTOR_IP}:4317を指す必要があります。コレクタとプロファイリングされたアプリケーションが同じホストで実行されている場合は、http://localhost:4317を使用します。他の場合は、プロファイリングされたホストからコレクタホストへのポート 4317 へのアクセスをブロックするファイアウォールルールがないことを確認してください。 -
Kubernetes デプロイメントの場合、OTLP エンドポイントは
http://$(K8S_NODE_IP):4317を指す必要があります。ここでK8S_NODE_IPは、アプリケーションを実行している Kubernetes ポッド上の環境構成を設定することにより、Kubernetes ダウンストリーム API からフェッチされます。例:
ポート 9943 は、コレクタ ディストリビューションの Splunk 受信者のデフォルトポートです。コレクタの構成でこのポートを変更した場合、カスタムポートを JVM に渡す必要があります。env: - name: K8S_NODE_IP valueFrom: fieldRef: apiVersion: v1 fieldPath: status.hostIP
プロファイリングデータ用に別のエンドポイントを設定するなど、その他の設定オプションについては、「コールグラフ プロファイリングの Java 設定」を参照してください。
Activate Call Graph Profiling in a gateway deployment
Learn how to activate Call Graph Profiling in a gateway deployment in Splunk APM.
Follow these steps to set up Call Graph Profiling with a collector in data forwarding or gateway mode, similar to the following example gateway deployment:
Point the instrumentation agent to the OTLP gRPC receiver for the collector in host monitoring (agent) mode. The OTLP gRPC receiver must be running on the same host and port as the collector in host monitoring (agent) mode.
Configure the collector in host monitoring (agent) mode with the following components:
An OTLP gRPC receiver
An OTLP exporter pointed at the collector in data forwarding (gateway) mode
- A logs pipeline that connects the receiver and the exporter. For example, see the default agent configuration with the necessary adjustment to send to a gateway in the Splunk OpenTelemetry Collector on GitHub.
>>service: pipelines: logs: receivers: [otlp] processors: - memory_limiter - batch - resourcedetection #- resource/add_environment #exporters: [splunk_hec, splunk_hec/profiling] # Use instead when sending to gateway exporters: [otlp]
Configure the collector in data forwarding (gateway) mode with the following components:
An OTLP gRPC receiver.
A splunk_hec exporter.
A logs pipeline that connects the receiver and the exporter.
Next step
Learn what you can do after you get data into Call Graph Profiling.
After you get data into Call Graph Profiling, you can Access a call graph and Analyze the performance of call stacks using call graphs.