0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Instana】Instanaの基本的な動きを理解する、試してみた

0
Last updated at Posted at 2026-07-01

はじめに

Instanaの自動監視について、以下の記事を参考にまずはエージェントがインストールされた時に何が起きているのか、ログを読み解き理解を深めます。
以下の参考記事の、「Intanaエージェントの開始」までです。

Agentインストール後の流れ

時刻 フェーズ 所要時間
0 Karafフレームワーク起動 約2秒
1 Agent Bootstrap 起動 約27秒
2 Agent本体モジュール インストール 約1分
3.4 Discoveryプラグイン インストール完了 → Discovery開始 数秒
5 各種センサー アクティベート 継続中

0. Karafフレームワーク起動

Adding features: service/[4.2.16], log/[4.2.16], instana-agent-bootstrap/[1.2.57]

Instana Agentは Apache Karaf というOSGiフレームワークの上で動いています。
まず Karaf 自身の基盤モジュール(shell, config, bundle管理など)が起動します。

モジュール 役割
org.apache.karaf.* コンテナ基盤(シェル・設定・バンドル管理)
org.jline.* コンソール入出力ライブラリ
org.ops4j.pax.url.wrap Maven依存解決ユーティリティ

OSGiフレームワークとは? アプリケーションをモジュール(バンドル)単位で管理し、実行中に機能の追加・更新・削除を可能にする仕組み。Instanaエージェントでは、この仕組みを利用してセンサーなどの機能を動的にロードしている。

1. Instana Agent Bootstrap 起動

エージェントの起動時に実行される初期化処理。

AgentBootstrap | Bootstrapping agent
AgentBootstrap | Running on vm-1, Linux 5.14.0-687.17.1.el9_8.x86_64 amd64
AgentBootstrap | Using Java 11.0.31 OpenJDK 64-Bit Server VM (Azul Systems, Inc.)
AgentBootstrap | Agent installed to /opt/instana/agent and started by root
AgentBootstrap | Dynamic agent running latest version

Instana本体の agent-bootstrap が起動。ホスト名・OS・Java情報を記録します。

Dynamic agent とは? インターネット経由でInstanaバックエンドから最新のセンサーを自動ダウンロードするタイプ。

2. Agent本体モジュールのインストール

Bundles to install:
  mvn:com.instana/agent/1.1.780
  mvn:com.instana/agent-backend/1.0.14
  mvn:com.instana/agent-grpc/1.0.20
  mvn:com.instana/agent-open-telemetry-base/2.2.6
  mvn:com.instana/agent-jvm-handling/1.0.50
  ... (約40モジュール)

Agent本体の構成モジュールが一括ダウンロード&インストールされます。

モジュール群 役割
agent-backend, agent-grpc Instana SaaSバックエンドとの通信
agent-jvm-handling JVMの検知・アタッチ処理
agent-open-telemetry-* OpenTelemetryトレース対応
agent-process-handling プロセス監視
agent-memory, agent-metaspace-monitor メモリ監視
otel-sensorsdk-* OTel経由のセンサーSDK(k8s/jvm/host等)

3. Discoveryプラグイン 一括インストール

Installed instana-ace-discovery/1.0.93
Installed instana-java-discovery/1.3.6
Installed instana-websphere-liberty-discovery/1.1.10
Installed instana-kafka-discovery/1.1.63
Installed instana-mysql-discovery/1.1.80
... (100種類以上)

監視対象を「見つける」ためのDiscoveryプラグインが全種類インストールされます。
この段階ではまだ監視していない、探索する準備をしているだけです。

ポイント: Discoveryプラグインは監視対象が存在するかどうかに関わらず全部インストールされます。「もし〇〇が動いていたら検知できるよう」スタンバイしている状態です。

4. Discovery 開始宣言

AgentBootstrap | Starting agent now
AgentImpl      | Starting Instana agent Discovery.
AgentImpl      | Instana agent Discovery started.

全Discoveryプラグインのインストール完了後、ディスカバリー処理が正式に開始されます。
ここからホスト上の監視対象を探し始めます。

5. 各種センサー アクティベート

DiscoveryがOSやホスト環境を検知し、対応するセンサーをダウンロード・起動します。

Installed instana-clr-trace-sensor
ClrTrace | Activated Sensor
ClrTrace | CLR-Tracing has been enabled

Installed instana-host-sensor
Host     | Activated Sensor

Ebpf     | Successfully started eBPF sensor.

Installed instana-netcore-trace-sensor
NetcoreTrace | .Net Core Tracing daemon activated

Installed instana-ebpf-sensor
センサー 何を監視するか
instana-host-sensor ホストOS(CPU/メモリ/ディスク等)
instana-clr-trace-sensor .NET Framework / .NET Coreのトレース
instana-netcore-trace-sensor .NET Coreアプリの分散トレーシング
instana-ebpf-sensor eBPFによるカーネルレベルのネットワーク監視

なぜ .NET センサーが? このサーバーにJavaはありますが .NET はありません。しかし Instana は「もし .NET プロセスが起動したらすぐ監視できるよう」センサーを先に起動しておく設計です。

まとめ

エージェントがインストールされると、まずは自動監視・自動検知をするためのKarafフレームワークが入って、その次にAgent初期化作業、Agent本体が入る。次に、各技術スタックに対応したDiscoveryプラグインが入る。Discoveryで検出されたプロセスに対して、対応するセンサーがダウンロード・インストールされ、アクティベートされる。

各技術スタックとは
Instanaが監視できるソフトウェアの種類。
instana-xxx-discoveryがインストールされていて、それ一つ一つ。Apache, Nginxとか。

対応するセンサーとは
例)Javaプロセスを見つけると、instana-java-sensorがアクティベートされる。

ここまでわかりました。
次は、OpenLibertyを起動するとInstanaがどういう挙動をするか、見ていきます!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?