Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 3.71 KB

framework-elastic_apm_agent.md

File metadata and controls

67 lines (48 loc) · 3.71 KB

Elastic APM Agent Framework

The Elastic APM Agent Framework causes an application to be automatically configured to work with Elastic APM.

Detection Criterion Existence of a single bound Elastic APM service. The existence of an Elastic APM service defined by the VCAP_SERVICES payload containing a service name, label or tag with elastic-apm as a substring.
Tags elastic-apm-agent=<version>
Tags are printed to standard output by the buildpack detect script

User-Provided Service

When binding Elastic APM using a user-provided service, it must have name or tag with elasticapm or elastic-apm in it. The credential payload can contain the following entries.

Name Description
server_urls The URLs for the Elastic APM Server. They must be fully qualified, including protocol (http or https) and port.
secret_token (Optional) This string is used to ensure that only your agents can send data to your APM server. Both the agents and the APM server have to be configured with the same secret token. Use if APM Server requires a token.
*** (Optional) Any additional entries will be applied as a system property appended to -Delastic.apm. to allow full configuration of the agent. See Configuration of Elastic Agent.

Creating an Elastic APM USer Provided Service

Users must provide their own Elastic APM service. A user-provided Elastic APM service must have a name or tag with elastic-apm in it so that the Elastic APM Agent Framework will automatically configure the application to work with the service.

Example of a minimal configuration:

cf cups my-elastic-apm-service -p '{"server_urls":"https://my-apm-server:8200","secret_token":"my-secret-token"}'

Example of a configuration with additional configuration parameters:

cf cups my-elastic-apm-service -p '{"server_urls":"https://my-apm-server:8200","secret_token":"","server_timeout":"10s","environment":"production"}'

Bind your application to the service using:

cf bind-service my-app-name my-elastic-apm-service

or use the services block in the application manifest file.

Configuration

For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to Configuration and Extension.

The framework can be configured by modifying the config/elastic_apm_agent.yml file in the buildpack fork. The framework uses the Repository utility support and so it supports the version syntax defined there.

Name Description
service_name This can be overridden by a service_name entry in the credentials payload. If neither are supplied the default is the application_name as specified by Cloud Foundry.
repository_root The URL of the Elastic APM repository index (details).
version The version of Elastic APM to use. Candidate versions can be found in this listing.