|
| 1 | +# DynaTrace Agent Framework |
| 2 | +The DynaTrace Agent Framework causes an application to be automatically configured to work with a bound [DynaTrace Service][] instance (Free trials available). |
| 3 | + |
| 4 | +The Cloud Foundry pushed application name is used as the `agent group` in DynaTrace, and must be pre-configured on the DynaTrace server. |
| 5 | +A system profile may be provided as an optional argument (defaults to `Monitoring`). |
| 6 | + |
| 7 | +**Current Issues:** |
| 8 | +* The DynaTrace agent slows down app execution significantly at first, but gets faster over time. You may want to update your CF deployment manifest to set `maximum_health_check_timeout` to 180 or more and/or execute `cf push -t 180` or more when pushing a DynaTrace-monitored application. |
| 9 | + |
| 10 | +* As you `cf push` multiple times, many dead penguins will litter the DynaTrace agent dashboard, as CF launches/disposes application containers. These can be hidden but will collect in the dynatrace database. |
| 11 | + |
| 12 | +<table> |
| 13 | + <tr> |
| 14 | + <td><strong>Detection Criterion</strong></td><td>Existence of a single bound DynaTrace service. |
| 15 | + <ul> |
| 16 | + <li>Existence of a DynaTrace service is defined as the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service who's name, label or tag has <code>dynatrace</code> as a substring.</li> |
| 17 | + </ul> |
| 18 | + </td> |
| 19 | + </tr> |
| 20 | + <tr> |
| 21 | + <td><strong>Tags</strong></td> |
| 22 | + <td><tt>dyna-trace-agent=<version></tt></td> |
| 23 | + </tr> |
| 24 | +</table> |
| 25 | +Tags are printed to standard output by the buildpack detect script |
| 26 | + |
| 27 | +## User-Provided Service |
| 28 | +Users must provide their own DynaTrace service. A user-provided DynaTrace service must have a name or tag with `dynatrace` in it so that the DynaTrace Agent Framework will automatically configure the application to work with the service. |
| 29 | + |
| 30 | +The credential payload of the service may contain the following entries: |
| 31 | + |
| 32 | +| Name | Description |
| 33 | +| ---- | ----------- |
| 34 | +| `server` | The DynaTrace collector hostname to connect to. Use `host:port` format for a specific port number. |
| 35 | +| `profile` | (optional) The DynaTrace server profile this is associated with. Uses `Monitoring` by default. |
| 36 | + |
| 37 | +**NOTE** Be sure to open an Application Security Group to your DynaTrace collector prior to starting your application: |
| 38 | +``` |
| 39 | +$ cat security.json |
| 40 | + [ |
| 41 | + { |
| 42 | + "protocol": "tcp", |
| 43 | + "destination": "dynatrace_host", |
| 44 | + "ports": "9998" |
| 45 | + } |
| 46 | + ] |
| 47 | +
|
| 48 | +$ cf create-security-group dynatrace_group ./security.json |
| 49 | +Creating security group dynatrace_group as admin |
| 50 | +OK |
| 51 | +
|
| 52 | +$ cf bind-running-security-group dynatrace_group |
| 53 | +Binding security group dynatrace_group to defaults for running as admin |
| 54 | +OK |
| 55 | +
|
| 56 | +TIP: Changes will not apply to existing running applications until they are restarted. |
| 57 | +``` |
| 58 | + |
| 59 | +## Configuration |
| 60 | +For general information on configuring the buildpack, refer to [Configuration and Extension][]. |
| 61 | + |
| 62 | +The framework can be configured by modifying the [`dyna_trace_agent.yml`][] file in the buildpack fork. The framework uses the [`Repository` utility support][repositories] and so it supports the [version syntax][] defined there. |
| 63 | + |
| 64 | +| Name | Description |
| 65 | +| ---- | ----------- |
| 66 | +| `repository_root` | The URL of the DynaTrace repository index ([details][repositories]). |
| 67 | +| `version` | The version of DynaTrace to use. This buildpack framework has been tested on 6.1.0. |
| 68 | + |
| 69 | + |
| 70 | +**NOTE:** This framework does not connect to a pre-populated repository. Instead you will need to create your own repository by: |
| 71 | + |
| 72 | +1. Downloading the DynaTrace agent unix binary (in JAR format) to an HTTP-accesible location |
| 73 | +1. Uploading an `index.yml` file with a mapping from the version of the agent to its location to the same HTTP-accessible location |
| 74 | +1. Configuring the [`dyna_trace_agent.yml`][] file to point to the root of the repository holding both the index and agent binary |
| 75 | + |
| 76 | +Sample **`repository_root`** for [`dyna_trace_agent.yml`][] (under java-buildpack/config) assuming a bosh-lite setup and a local webserver (e.g. `brew install tomcat7`) on port 8080 |
| 77 | + |
| 78 | +``` |
| 79 | +repository_root: "http://files.192.168.50.1.xip.io:8080/fileserver/dynatrace" |
| 80 | +``` |
| 81 | + |
| 82 | +The buildpack would look for an **`index.yml`** file at the specified **repository_root** for obtaining the DynaTrace agent. |
| 83 | + |
| 84 | +The index.yml at the repository_root location should have a entry matching the DynaTrace version and the corresponding DynaTrace agent download JAR |
| 85 | + |
| 86 | +``` |
| 87 | +--- |
| 88 | +6.1.0.7880: http://files.192.168.50.1.xip.io:8080/fileserver/dynatrace/dynatrace-agent-6.1.0.7880-unix.jar |
| 89 | +``` |
| 90 | + |
| 91 | +Ensure the DynaTrace binary is available at the location indicated by the index.yml referred by the DynaTrace repository_root. |
| 92 | + |
| 93 | +[Configuration and Extension]: ../README.md#configuration-and-extension |
| 94 | +[`dyna_trace_agent.yml`]: ../config/dyna_trace_agent.yml |
| 95 | +[DynaTrace Service]: https://dynatrace.com |
| 96 | +[repositories]: extending-repositories.md |
| 97 | +[version syntax]: extending-repositories.md#version-syntax-and-ordering |
0 commit comments