Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 56 additions & 2 deletions docs/framework-app_dynamics_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ The AppDynamics Agent Framework causes an application to be automatically config

<table>
<tr>
<td><strong>Detection Criterion</strong></td><td>Existence of a single bound AppDynamics service. The existence of an AppDynamics service defined by the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service name, label or tag with <code>app-dynamics</code> or <code>appdynamics</code> as a substring.
<td><strong>Detection Criterion</strong></td><td>Existence of a single bound AppDynamics service, or an application-provided AppDynamics agent. The existence of an AppDynamics service is defined by the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service name, label or tag with <code>app-dynamics</code> or <code>appdynamics</code> as a substring. An application-provided agent archive or <code>.appdynamics/</code> directory (see <a href="#bring-your-own-agent">Bring Your Own Agent</a>) is detected without a service binding.
</td>
</tr>
<tr>
Expand All @@ -25,6 +25,7 @@ When binding AppDynamics using a user-provided service, it must have name or tag
| `application-name` | (Optional) the application's name
| `node-name` | (Optional) the application's node name
| `tier-name` | (Optional) the application's tier name
| `agent-uri` | (Required unless an application-provided agent is used) HTTP(S) URL to an AppDynamics agent archive (`.zip`, `.tar.gz` or `.tgz`). See [Bring Your Own Agent](#bring-your-own-agent). |

To provide more complex values such as the `tier-name`, using the interactive mode when creating a user-provided service will manage the character escaping automatically. For example, the default `tier-name` could be set with a value of `Tier-$(expr "${VCAP_APPLICATION}" : '.*instance_index[": ]*\([[:digit:]]*\).*')` to calculate a value from the Cloud Foundry instance index.

Expand All @@ -33,7 +34,60 @@ To provide more complex values such as the `tier-name`, using the interactive mo
## Configuration
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].

The framework has no user-configurable options. The AppDynamics agent version is managed by the buildpack manifest. See [Additional Resources](#additional-resources) below for application-level configuration options.
The framework does not download the AppDynamics agent from the upstream `manifest.yml`. The agent version is determined by the artifact you provide. See [Bring Your Own Agent](#bring-your-own-agent).

## Bring Your Own Agent
The buildpack does not bundle or download the AppDynamics Java agent. Provide it using one of the following methods. Sources are tried in this order: `agent-uri` credential, application-provided agent, then a forked buildpack manifest.

### Service binding credential
Set `agent-uri` on the bound service to an HTTP(S) URL that returns an AppDynamics agent archive. `.zip`, `.tar.gz` and `.tgz` archives are supported. The URL may embed HTTP basic authentication credentials (`https://user:password@host/...`).

The credential is looked up on every bound AppDynamics service, so a marketplace binding without a URI does not hide a user-provided binding that has one. The following aliases are also accepted: `agent_uri`, `agent_url`, `agent-url`, `agent-download-url`, `agent_download_url`, `customoneagenturl`.

Example:

```bash
cf create-user-provided-service appdynamics -p '{
"host-name": "controller.example.com",
"port": "443",
"ssl-enabled": "true",
"account-name": "customer1",
"account-access-key": "secret",
"agent-uri": "https://artifacts.example.com/appdynamics/AppServerAgent-26.10.0.38851.zip"
}'
```

If the download fails, the buildpack logs a warning and falls back to the next source.

### Application-provided agent
Vendor the agent in the application, either as an archive or as an already-unpacked directory. Archives may be placed in the application root, `.appdynamics/` or `.app-dynamics/`:

- `appdynamics-agent.zip`
- `appdynamics-agent.tar.gz`
- `appdynamics-agent.tgz`

Alternatively, unpack the standard AppDynamics AppServerAgent layout into a `.appdynamics/` (or `.app-dynamics/`) directory. Both the archive and directory layouts must contain `javaagent.jar`.

A bound AppDynamics service is used for controller configuration. If you vendor a fully configured agent (including its `conf/controller-info.xml`), no service binding is required: detection falls back to the application-provided agent, the same way New Relic supports an application-provided `.new-relic-credentials` directory.

### Forked buildpack manifest
Like the IBM JRE, the upstream buildpack has no `appdynamics` dependency. If you fork the buildpack, you can add one and the agent will be installed from it when no runtime source is configured:

```yaml
default_versions:
- name: appdynamics
version: 26.x
dependencies:
- name: appdynamics
version: 26.10.0.38851
uri: https://artifacts.example.com/appdynamics/AppServerAgent-26.10.0.38851.zip
sha256: <sha256>
cf_stacks:
- cflinuxfs4
- cflinuxfs5
```

If no source is available, staging fails with an error that describes all three options.

### Additional Resources
The framework can be configured by providing custom configuration files.
Expand Down
6 changes: 3 additions & 3 deletions src/integration/frameworks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func testFrameworks(platform switchblade.Platform, fixtures string, sb3JarPath,

context("with AppDynamics service binding", func() {
it("detects and installs AppDynamics agent", func() {
t.Skip("SKIPPED: AppDynamics agent requires authentication and is not in manifest.yml - agent must be provided via service binding or downloaded at runtime")
t.Skip("SKIPPED: AppDynamics is bring-your-own-agent - this fixture does not provide an agent archive or agent-uri")
deployment, logs, err := platform.Deploy.
WithServices(map[string]switchblade.Service{
"appdynamics": {
Expand All @@ -93,7 +93,7 @@ func testFrameworks(platform switchblade.Platform, fixtures string, sb3JarPath,
})

it("configures AppDynamics with controller info from service binding", func() {
t.Skip("SKIPPED: AppDynamics agent requires authentication and is not in manifest.yml - agent must be provided via service binding or downloaded at runtime")
t.Skip("SKIPPED: AppDynamics is bring-your-own-agent - this fixture does not provide an agent archive or agent-uri")
deployment, logs, err := platform.Deploy.
WithServices(map[string]switchblade.Service{
"my-appdynamics-service": {
Expand Down Expand Up @@ -160,7 +160,7 @@ func testFrameworks(platform switchblade.Platform, fixtures string, sb3JarPath,

context("with multiple APM agents", func() {
it("can handle multiple agent service bindings", func() {
t.Skip("Test uses AppDynamics which requires authentication and is not in manifest - skipping until test is updated to use agents that work without auth")
t.Skip("Test uses AppDynamics, which is bring-your-own-agent; the fixture does not provide an agent archive or agent-uri")
deployment, logs, err := platform.Deploy.
WithServices(map[string]switchblade.Service{
"newrelic": {
Expand Down
Loading