Upgrade the JavaScript Agent
Related pages:
This page covers how to upgrade the JavaScript Agent version. Upgrading to the latest version of the JavaScript Agent will allow you to use the latest features and get the latest bug fixes.
The following sections will discuss possible compatibility issues, show you a new way to include the JavaScript Agent, and provide you with manual injection code examples for the different JavaScript Agent hosting options.
Compatibility Issues
- If you are using a SaaS EUM Cloud and want a hosted version of adrum.js, we recommend you to use the adrum-latest.js version. However, you can use any version of the JavaScript Agent as it is compatible with any SaaS EUM Cloud version currently being deployed.
- For Controller versions, a JavaScript Agent version is compatible with Controller versions with the same or older versions.
For more information, see Controller Compatibility with Agents.
インジェクションコードの変更
JavaScript エージェントをホストしているサーバーへの URL が HTTP と HTTPS の両方で同じである場合は、<script> タグを挿入するために document.write を使用する必要はありません。代わりに、次の構文を使用して <script> タグをハードコーディングするだけです。
<script src="//cdn.appdynamics.com/adrum/adrum.js"></script>さまざまなホスティングオプションのインジェクションコード
- Splunk AppDynamics CDN
-
次の文字列では、
- 次のコードの文字列 <EUM_APP_KEY> を独自の EUM アプリケーションキーに置き換えます。
- 次のコードの <eum-col.appdynamics.com> を、対応するコレクタ URL に置き換えます。
<script charset='UTF-8'> window['adrum-start-time'] = new Date().getTime(); (function(config){ config.appKey = '<EUM_APP_KEY>'; config.adrumExtUrlHttp = 'http://cdn.appdynamics.com'; config.adrumExtUrlHttps = 'https://cdn.appdynamics.com'; config.beaconUrlHttp = 'http://eum-col.appdynamics.com'; config.beaconUrlHttps = 'https://eum-col.appdynamics.com'; config.xd = {enable : false}; })(window['adrum-config'] || (window['adrum-config'] = {})); <script src='//cdn.appdynamics.com/adrum/adrum-latest.js'></script>
- 自己ホスト
-
次のコードスニペットでは、
- 文字列 <EUM_APP_KEY> を独自の EUM アプリケーションキーに置き換えます。
- 文字列 <your-cdn.com> を JavaScript エージェントをホスティングしているサーバーへの URL に置き換えます。
- 次のコードの <eum-col.appdynamics.com> を、対応するコレクタ URL に置き換えます。
<script charset='UTF-8'> window['adrum-start-time'] = new Date().getTime(); (function(config){ config.appKey = '<EUM_APP_KEY>'; config.adrumExtUrlHttp = 'http://<your-cdn.com>'; config.adrumExtUrlHttps = 'https://<your-cdn.com>'; config.beaconUrlHttp = 'http://eum-col.appdynamics.com'; config.beaconUrlHttps = 'http://eum-col.appdynamics.com'; config.xd = {enable : false}; })(window['adrum-config'] || (window['adrum-config'] = {})); </script> <script src='//<your-cdn.com>/adrum/adrum.js'></script>
- 共有ホスト
-
次のコードスニペットでは、
- 文字列 <EUM_APP_KEY> を独自の EUM アプリケーションキーに置き換えます。
- 文字列 <your-cdn.com> を JavaScript エージェントをホスティングしている場所への URL に置き換えます。
- 次のコードの <eum-col.appdynamics.com> を、対応するコレクタ URL に置き換えます。
<script charset='UTF-8'> window['adrum-start-time'] = new Date().getTime(); (function(config){ config.appKey = '<EUM_APP_KEY>'; config.adrumExtUrlHttp = 'http://cdn.appdynamics.com'; config.adrumExtUrlHttps = 'https://cdn.appdynamics.com'; config.beaconUrlHttp = 'http://eum-col.appdynamics.com'; config.beaconUrlHttps = 'https://eum-col.appdynamics.com'; config.xd = {enable : false}; })(window['adrum-config'] || (window['adrum-config'] = {})); </script> <script src='//<your-cdn.com>/adrum/adrum.js'></script>