Add Support for CloudFoundry Resource Attributes #12861
Open
Description
Is your feature request related to a problem? Please describe.
When running an application as a CloudFoundry deployment, the Cloud Foundry attributes should be filled automatically. This allows connecting the observability data with the application metadata as used by Cloud Foundry.
Describe the solution you'd like
An application deployed to Cloud Foundry receives the necessary metadata in the environment variable VCAP_APPLICATION
. The contents of this variable is a JSON document whose fields can be mapped to the CloudFoundry attributes by the following mapping.
- VCAP_APPLICATION(application_id) -> cloudfoundry.app.id
- VCAP_APPLICATION(application_name) -> cloudfoundry.app.name
- VCAP_APPLICATION(instance_index) -> cloudfoundry.app.instance.id (convert int to string)
- VCAP_APPLICATION(organization_id) -> cloudfoundry.org.id
- VCAP_APPLICATION(organization_name) -> cloudfoundry.org.name
- VCAP_APPLICATION(process_id) -> cloudfoundry.process.id
- VCAP_APPLICATION(process_type) -> cloudfoundry.process.type
- VCAP_APPLICATION(space_id) -> cloudfoundry.space.id
- VCAP_APPLICATION(space_name) -> cloudfoundry.space.name
All of this can be done in a ResourceProvider
, that searches for the environment variable VCAP_APPLICATION
and applies this mapping, if it is found.
Describe alternatives you've considered
CloudFoundry developers can run custom extensions on the Java Agent to provide this functionality.
Additional context
No response