Metric Writer Framework

September 4, 2019 ยท View on GitHub

The Metric Writer Framework causes an application to be automatically configured to add Cloud Foundry-specific Micrometer tags.

Detection Criterion Existence of a micrometer-core*.jar file in the application directory
Tags metric-writer-reconfiguration=<version>
Tags are printed to standard output by the buildpack detect script

The Metric Writer Framework adds a set of CloudFoundry-specific Micrometer tags to any Micrometer metric that does not already contain the keys. The values of these tags can be explicitly configured via environment variables otherwise they default to values extracted from the standard Cloud Foundry runtime environment.

TagEnvironment VariableDefault
cf.accountCF_APP_ACCOUNT$VCAP_APPLICATION / cf_api
cf.applicationCF_APP_APPLICATION$VCAP_APPLICATION / application_name / frigga:name
cf.clusterCF_APP_CLUSTER$VCAP_APPLICATION / application_name / frigga:cluster
cf.versionCF_APP_VERSION$VCAP_APPLICATION / application_name / frigga:revision
cf.instance.indexCF_APP_INSTANCE_INDEX$CF_INSTANCE_INDEX
cf.organizationCF_APP_ORGANIZATION$VCAP_APPLICATION / organization_name
cf.spaceCF_APP_SPACE$VCAP_APPLICATION / space_name

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/metric_writer.yml file in the buildpack fork. The framework uses the Repository utility support and so it supports the version syntax defined there.

NameDescription
enabledWhether to attempt metric augmentation
repository_rootThe URL of the Metric Writer repository index (details).
versionThe version of Metric Writer to use. Candidate versions can be found in this listing.