配置側寫

本節說明如何配置 Instana AutoProfile™。

Java

支援的 JVM

目前在 HotSpotOpenJ9 型 JVM 上支援 AutoProfile 。

支援具有 JVM 版本 1.8.152 及更高版本的 HotSpot 型發行套件:

  • AdoptOpenJDK HotSpot
  • Amazon Corretto
  • Azul Zulu
  • Eclipse Temurin
  • OpenJDK
  • Oracle HotSpot
  • Sun HotSpot

0.29.0 版及更新版本支援的 OpenJ9 型 JVM:

  • IBM Semeru

目前僅在 x86_64-bit Linux (glibc 型及 musl 型 OS) 上支援 AutoProfile 。

配置

若要啟用側寫,請編輯代理程式配置檔 <agent_install_dir>/etc/instana/configuration.yaml:

com.instana.plugin.profiling.java:
  enabled: true

其他配置選項

參數 說明
cpu-sampler-enabled 設為 true時,會啟用 CPU 設定檔。
contention-sampler-enabled 設為 true時,會啟用競爭設定檔。

疑難排解

  • Cannot load JVM TI agent library: /tmp/libprofsensor-X.X.X-linux-x64-28c63c.so: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory。 對於在 Apline 映像檔中執行的 JVM ,側寫程式預期 musl libc 可用。 在同時基於相容性原因而安裝 glibc 的情況下,請確保不會改寫或岔斷程式庫 musl 版本的路徑。

Node.js

若要啟用 AutoProfile™,請在起始設定收集器時新增 autoProfile: true 選項 (或設定環境變數 INSTANA_AUTO_PROFILE=true)。 此特性需要 @instana/collector@1.98.1 或更新版本,以及至少 Node.js 6.4.0。

require('@instana/collector')({
  autoProfile: true
});

如需相關資訊,請參閱 Node.js 收集器配置

Go

若要啟用 AutoProfile™ 新增 EnableAutoProfile: true 選項至 instana.InitSensor(opt) (或針對 github.com/instana/go-sensor@1.13.2 及以上版本設定環境變數 INSTANA_AUTO_PROFILE=true )。 此特性需要在應用程式碼內啟動 Instana 感應器。 請參閱 AutoProfile™ 使用手冊 ,以瞭解如何執行此動作。

如需相關資訊,請參閱 Go 配置

Python

若要啟用 AutoProfile™ ,請設定環境變數 INSTANA_AUTOPROFILE=true。 此特性需要在應用程式碼內啟動 Instana Python 感應器。 請參閱 手動安裝 ,以瞭解如何執行此動作。

如需相關資訊,請參閱 Python 配置

Ruby

若要啟用 AutoProfile™ ,請將下列內容新增至代理程式的 configuration.yml

com.instana.plugin.rubyprofile:
  enabled: true

.NET Core

對於 .NET 使用者, AutoProfile™ 僅適用於在 Linux上執行的 .NET Core 應用程式。 如需相關資訊,請參閱 Monitoring .NET Core on Linux

若要啟用 AutoProfile™,請將下列設定新增至代理程式的 configuration.yml 檔案:

com.instana.plugin.netcore:
  profiling:
    enabled: true