2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Instana dynamic agentのバージョンを下げる

2
Last updated at Posted at 2022-08-09

はじめに

Instana ホストエージェントはdynamicとstaticの2つのタイプがあります。dynamicエージェントでは、エージェントを自動更新する機能があるので、基本的にはメンテナンスフリーで運用することができます。

ここでは、何かしらの理由により、Instana dynamic agentを最新ではなく、以前のリリースに下げて使用したい場合を想定して、バージョンを下げていきます。

検証に使用した環境は以下です。

  • Instana Backend: Self-Hosted(Single) Build 227
  • Instana Agentインストール先のOS: CentOS 7.9

Instana Agentのバージョンの詳細は以下の通りです。

[root@host instana]# curl localhost:42699/version
Name                                                 │ Version │ State
─────────────────────────────────────────────────────┼─────────┼─────────
Instana - Agent - GitOps - Discovery                 │ 1.1.3   │ Active
Instana - Agent - Bootstrap - Bundle                 │ 1.2.18  │ Active
Instana - Agent - Bundle                             │ 1.1.647 │ Active
Instana - Agent - API                                │ 1.0.0   │ Active
Instana - Agent - Init                               │ 1.0.2   │ Active
Instana - Sensor - API - JSON                        │ 1.2.117 │ Active
Instana - Agent - Netty anti leak                    │ 1.0.0   │ Active
Instana - Agent - Optional API                       │ 1.0.0   │ Active
Java Concurrency Tools Core Library                  │ 2.1.1   │ Active
Instana - Sensor - API - Interfaces                  │ 1.2.117 │ Active
Instana - Agent - Unix Socket Util                   │ 1.2.3.0 │ Active
Instana - IBM ACE - Discovery                        │ 1.0.39  │ Active
(省略)

Instana Agentのバージョンについて

Instanaのdynamicエージェントはブート・バージョン(bootstrap) と、エージェントバージョンが分かれて保持されています。

ブート・バージョンはエージェント起動時に使用するコンポーネントのバージョンで、エージェントインストール時に最新版が導入されますが、日々の自動更新ではアップデートされません。明確な指示がない限り、そのまま古いバージョンを使用していても問題ありません。

エージェントバージョンはエージェント本体とセンサー群のリリースを表すバージョンです。自動更新によりアップデートされ、最新のリリースの場合には、Backend UI上でLatestと表示されます。一方で、エージェントバージョンが最新でない場合には、SHA値で表示されます。このSHA値はこちらで確認可能です。
スクリーンショット 2022-08-09 12.01.21.png

Instana Agentのバージョンを指定(固定)する

ドキュメントに記載されている通り、dynamicエージェントのバージョンをpinning(固定)することができます。この機能は、自動更新を適用せずに指定のバージョンを使い続ける際に使用するものですが、過去バージョンを指定すると、そのバージョンで構成された上で固定されます。つまり、バージョンを下げることができます。

デフォルトでは、設定ファイルはありませんので、templateファイルをコピーして設定します。

[root@host ~]# cd /opt/instana/agent/etc/instana
[root@host instana]# cp -p com.instana.agent.bootstrap.AgentBootstrap.cfg.template com.instana.agent.bootstrap.AgentBootstrap.cfg
[root@host instana]# vi com.instana.agent.bootstrap.AgentBootstrap.cfg

versionの行を追加します。(+はdiff表現のため不要です。念の為。)
上述の通り、SHA値で指定します。過去のCommitのSHA値を指定すると、バージョンを下げることになります。

# This field specifies which version set of components should be used by the agent;
# its value must be a valid commit hash from https://github.com/instana/agent-updates/commits/public
# This agent uses dynamic updates
# version = <sha-1>
+ version = 066e1361fc90fb093d35703d75c5b8a0f1fa767e

origin = package dynamic

エージェントのサポートはリリースから6ヶ月間ですのでご注意ください。
詳細はサポートポリシーをご確認ください。

Instana Agentを再起動する

指定したバージョンで動作するように、dynamicエージェントを再起動します。

[root@host instana]# systemctl stop instana-agent
[root@host instana]# systemctl start instana-agent

エージェントのログにpinされたバージョンで動作している旨が出力されます。

[root@host instana]# grep pinned /opt/instana/agent/data/log/agent.log 
2022-08-08T19:18:59.039-05:00 | INFO  | features-3-thread-1              | AgentBootstrap   | com.instana.agent-bootstrap - 1.2.18 | Dynamic agent running pinned version 066e1361fc90fb093d35703d75c5b8a0f1fa767e and installed from package dynamic

改めてバージョンを確認すると、バージョンが一部下がっていることが確認できます。

[root@host instana]# curl localhost:42699/version
Name                                                 │ Version │ State
─────────────────────────────────────────────────────┼─────────┼─────────
Instana - Agent - GitOps - Discovery                 │ 1.1.3   │ Active
Instana - Agent - Bootstrap - Bundle                 │ 1.2.18  │ Active
Instana - Agent - Bundle                             │ 1.1.644 │ Active
Instana - Agent - Init                               │ 1.0.2   │ Active
Instana - Sensor - API - JSON                        │ 1.2.117 │ Active
Instana - Agent - Optional API                       │ 1.0.0   │ Active
Java Concurrency Tools Core Library                  │ 2.1.1   │ Active
Instana - Sensor - API - Interfaces                  │ 1.2.117 │ Active
Instana - Agent - Unix Socket Util                   │ 1.2.3.0 │ Active
Instana - IBM ACE - Discovery                        │ 1.0.36  │ Active
(省略)

おわりに

使う機会があまりないと思いますが(無いことを祈ります)、参考になれば幸いです。

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?