Splunk AppDynamics拡張ビルドパック」を参照してください。

v4.6.x 以降、Splunk AppDynamics では拡張ビルドパックの appdbuildpack を提供しています。Cloud Foundry のマルチビルドパック ワークフローを使用して、この拡張ビルドパックを標準のビルドパックと組み合わせて使用することができます。このビルドパックは、Splunk AppDynamics APM サポートのためのシングルポイントとして機能します。

注: Java ビルドパックは、マルチビルドパック方法をサポートしていません。そのため、Splunk AppDynamics APM サポートは Java ビルドパックに直接導入され、マルチビルドパック アプローチは Java アプリケーションには使用されません。

サンプル アプリケーション

この GitHub リポジトリで、マルチビルドパック アプローチについて示すサンプルアプリケーションを見つけることができます。

はじめる前に

複数のビルドパックを使用するには、Cloud Foundry Command Line Interface(cf CLI)v6.38 以降が必要です。「Installing the cf CLI」を参照してください。

WorkFlow

「拡張ビルドパック」を参照してください。
  1. VMware Tanzu 用 AppDynamics アプリケーション パフォーマンス モニタリング タイル バージョン v4.6.x 以降をインストールまたはアップグレードします。
  2. VMware Tanzu 用 Splunk AppDynamics APM タイルがインストールされていることを確認します。
    VMware Tanzu 用 appdbuildpack APM タイルがインストールされると、 という名前のビルドパックが cf 環境のビルドパックのリストに表示されます。
    $ cf buildpacks
    Getting buildpacks...
    buildpack                position   enabled   locked   filename                                             stack
    meta_buildpack           1          true      false    meta_buildpack-v1.1.0.zip
    ...
    appdbuildpack            25         true      false    AppDynamics_buildpack-v4.6.10.zip
  3. アプリケーションの manifest.yml の次のセクションを編集します。
    1. buildpacks セクションに appdbuildpack 拡張ビルドパックを含めます。
      buildpacks: - appdbuildpack - <language specific buildpack>
    2. env セクションで、アプリケーションの言語に対応する APPD_AGENT 環境変数を設定します。
      env:
      APPD_AGENT: dotnet
    3. services セクションに含めることで、アプリケーションを Splunk AppDynamics サービスインスタンスにバインドします。
      services:
      - appd
  4. アプリケーションをプッシュするには、cf CLI コマンド を使用します。
    $ cf push

APPD_AGENT 値

言語 標準ビルドパック APPD_AGENT 値
NET Framework(Windows) hwc_buildpack dotnet
.NET Core(Linux) dotnet_core_buildpack dotnet-linux
.NET Core(Windows) binary_buildpack dotnet-windows
Python python_buidpack python
GoLang go_buildpack golang
NodeJS nodejs-buildpack nodejs

Advanced Features

The Splunk AppDynamics extension buildpack supports configurable environment variables. This allows you to customize how you fetch agent binaries and override agent configuration.

Overriding Agent Binary Downloads

By default appdbuildpack fetches the corresponding Splunk AppDynamics agent from standard language-specific repositories (NuGet for .NET, PyPI for Python and NPM for Node.js). For .NET Framework, .NET Core Windows and Node.js applications, it's possible to override the repository where appdbuildpack fetches the agents. If you set the environment variable APPD_AGENT_HTTP_URL to a custom http url where the agent files are hosted, appdbuildpack then downloads the agent from that url and installs the agent.

注: If the custom download location requires basic authentication, then you can provide the credentials by specifying the APPD_BASIC_AUTH_USERNAME and APPD_BASIC_AUTH_PASS environment variables.

For example, for a .NET Framework application, set APPD_AGENT_HTTP_URL and basic authentication credential variables (if required) in the env section of the manifest.yaml, and redeploy the application.

env:
APPD_AGENT: dotnet
APPD_AGENT_HTTP_URL: http://<path to custom NuGet package binaries>
APPD_BASIC_AUTH_USERNAME: <username> # basic auth username (optional)
APPD_BASIC_AUTH_PASS: <password> # basic auth password (optional)

Overriding Agent Configuration

By default appdbuildpack creates the basic configuration required by the Splunk AppDynamics Agent to instrument the application. This includes the application Splunk AppDynamics name, tier, node and Controller information.

注: The APPD_CONF_HTTP_URL feature has been integrated in the Java buildpack and uses java as the APPD_AGENT value. See Java Applications workflow documentation.

For .NET Framework, .NET Core Windows, .NET Core for Linux and Python applications, appdbuildpack facilitates additional configuration to the agents or overriding the existing default configuration. To achieve this, set the APPD_CONF_HTTP_URL environment variable to a custom HTTP URL where advanced agent configuration files are hosted. The extension buildpack downloads the relevant files related to the Splunk AppDynamics agent and extends the agent configuration.

env:
APPD_AGENT: dotnet
APPD_CONF_HTTP_URL: http://custom-http-server.com
APPD_BASIC_AUTH_USERNAME: <username> # basic auth username (optional)
APPD_BASIC_AUTH_PASS: <password> # basic auth password (optional)

appdbuildpack checks configuration files under a subfolder relative to APPD_CONF_HTTP_URL according to the APPD_AGENT value. So for a .Net Core Linux application, for example, it would look for relevant configuration files such as AppDynamicsConfig.json under APPD_CONF_HTTP_URL/dotnet-linux, and for a Python application it would look under APPD_CONF_HTTP_URL/python. In the preceding example, it would look under http://custom-http-server.com/dotnet.

This supports the ability to assign a single value for APPD_CONF_HTTP_URL staging environment variable group and avoids the need to set it for each application.

$ cf set-staging-environment-variable-group '{"APPD_CONF_HTTP_URL":"http://custom-http.server.com"}'
  • When using APPD_CONF_HTTP_URL, appdbuildpack will only fetch the files with relevant names that are applicable to the agent. In the example above, because it is a dotnet agent, only the files AppDynamicsAgentLog.config and AppDynamicsConfig.json are downloaded from APPD_CONF_HTTP_URL/dotnet. All other files are ignored.

  • When using APPD_AGENT_HTTP_URL, the full path including the agent package must be specified, for example—http://custom-http.server.com/dotnet-linux/agent/AppDynamics-DotNetCore-linux-x64-4.5.7.0.zip.

  • Refer to the Install App Server Agents for the names and formats of the advanced configuration files applicable to each of the Splunk AppDynamics agents.

サンプル manifest.yml

---
applications:
- name: cf-net-linux
random-route: true
memory: 1G
buildpacks:
- appdbuildpack
- dotnet_core_buildpack
env:
APPD_AGENT: dotnetcore
APPD_AGENT_HTTP_URL: http://custom-http-server.com/dotnet-linux/agent/AppDynamics-DotNetCore-linux-x64-4.5.7.0.zip
APPD_CONF_HTTP_URL: http://custom-http-server.com
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
services:
- appd

このアプローチを使用する利点

  • appdbuildpack と標準規格システムビルドパックの間の役割の明確な分離。appdbuildpack が、Splunk AppDynamics のインストルメンテーションに関連するすべての役割を単独で果たすようになります。

  • Splunk AppDynamics に関連する新機能は、appdbuildpack を通じて提供されます。これにより、標準のビルドパックを使用して Splunk AppDynamics ビットを提供する場合と比較して、新機能のための所要時間が大幅に短縮されます。

  • アプリケーションの言語やフレームワークに関係なく、さまざまなアプリケーションをインストゥルメント化するための単一の統合ワークフロー。appdbuildpack が AppDynamics インストゥルメンテーション ロジックの唯一のソースとなるため、appdbuildpack に追加された新機能は、該当する場合、すべての言語のエージェントで使用できます。