Monitor Cloud Foundry container metrics and PaaS resource definitions with the Dynatrace extension for full infrastructure observability.
This extension uses the Cloud Foundry API (CAPI) to connect to the foundation and collect resource definitions and metadata for the following resource types:
This data can be ingested as metrics and optionally as events.
Use this extension for:
read-only access to Cloud Controller API resources. cloud_controller.admin_read_only permission.v3/[RESOURCE] and legacy v2 APIs for /v2/info and [TOKEN_ENDPOINT]/oauth/tokenFind Cloud Foundry in the in-product Extensions or Hub page and activate it.
Once the extension is activated in your environment, you can create monitoring configurations.
Connection Name: A basic name for this connection. This appears as the foundation name property.
Extension Schedule: How often the extension should run (default is every 1 minute).
CloudFoundry API Target (API_URL): The API to connect to, for example https://api.<your-cf-domain>.
Username and Password Credentials: Cloud Foundry username and password, stored securely in the Dynatrace Credential Vault.
We recommend using a Cloud Foundry admin read-only account that can view almost all Cloud Controller API resources, but can't modify them.
Example:
uaac user add ReadOnlyUser -p SecretPassword --emails something@example.comuaac member add cloud_controller.admin_read_only ReadOnlyUseruaac member add scim.read ReadOnlyUser
Optional CloudFoundry Client Credentials: Cloud Foundry client_id and client_secret. Use this only when your Cloud Foundry environment does not use the default public OAuth2 client (client_id: cf, no secret).
Ingest Resource JSON: Ingest resource definitions as a Dynatrace log event. This is useful to query and view, but the metrics will already contain much of this in dimensions.
Optional User Network Proxy: Connect from the Dynatrace ActiveGate to the Cloud Foundry API through a proxy. Provide Proxy Host, Username, and Password.
Verify SSL Certificates: Validate SSL/TLS certificates for this connection. Disable only for environments with self‑signed certificates, or use a custom certificate path.
Getting Started with Cloud Foundry CAPI v3
Your Cloud Foundry API endpoint is typically available at: https://api.<your-cf-domain>. In the extension configuration this full URL is entered for the: 'CloudFoundry API Target' - API_URL.
A request for metadata is made to [API_URL]/v2/info which also includes the UAA TOKEN_ENDPOINT for Oauth authentication.
Example:
{"custom.api": "https://api.example.com","name": "VMware Tanzu Application Service","build": "2.10.35-build.1","support": "https://support.pivotal.io","version": 0,"description": "https://docs.pivotal.io/pivotalcf/2-10/pcf-release-notes/runtime-rn.html","authorization_endpoint": "https://login.example.com","token_endpoint": "https://uaa.example.com","min_cli_version": "6.23.0","min_recommended_cli_version": "6.23.0","app_ssh_endpoint": "ssh.example.com:2222","app_ssh_host_key_fingerprint": "...","app_ssh_oauth_client": "ssh-proxy","doppler_logging_endpoint": "wss://doppler.example:443","api_version": "2.150.0","osbapi_version": "2.15","routing_endpoint": "https://api.example.com/routing"}
Direct UAA Authentication is then used to retrieve a bearer token using a password grant type.
The token is then used to authenticate resource GET requests: [API_URL]/v3/[RESOURCE] e.g., https://api.example.com/v3/organizations
The extension will then parse each response into metrics with metadata dimensions, and if enabled ingest the resource definition as a log event.
This extension ingests metrics and optionally logs. For more information about licensing costs, see Extending Dynatrace (Davis data units) or Metrics powered by Grail overview (DPS) depending on your license model.
Organizations, Apps, Spaces, etc. are collected each polling interval. More volatile resources such as Builds, Droplets, Packages, and Processes are only collected when updated.A custom entity type is created for each resource. You can visualize this topology in
Infrastructure & Operations or use it in custom dashboards, queries or alerts.
dt:cloudfoundry_foundationdt:cloudfoundry_appdt:cloudfoundry_builddt:cloudfoundry_domaindt:cloudfoundry_dropletdt:cloudfoundry_orgdt:cloudfoundry_org_quotadt:cloudfoundry_packagedt:cloudfoundry_processdt:cloudfoundry_routedt:cloudfoundry_service_instancedt:cloudfoundry_spaceTo set up Dynatrace for Full stack monitoring on CloudFoundry refer to: Set up Dynatrace on Cloud Foundry. This allows you to deploy OneAgents to your Cloud Foundry cluster VMs and monitor the platform.
With both integrations enabled you then have:
You can then use the Dynatrace Query Language (DQL) to map and visualize this data together. Examples:
GUID from the https://api.example.com/v3/apps API.CF_APP_ID available in the process metadata. This is collected from the container VCAP_APPLICATION environment variablefetch `dt.entity.dt:cloudfoundry_app`| fields id,guid| lookup [fetch dt.entity.process_group_instance| filter matchesPhrase(softwareTechnologies, "GARDEN")| fields metadata, customPgMetadata, gardenApplicationNames, softwareTechnologies, id, entity.name, instance_of| fieldsAdd cf_app_id = arrayFirst(arrayRemoveNulls(iCollectArray(parse(metadata[], """'CLOUD_FOUNDRY_APP_ID:' LD:CLOUD_FOUNDRY_APP_ID"""))))| filter isNotNull(cf_app_id)| fieldsAdd process_group_id = instance_of[dt.entity.process_group]], sourceField: guid, lookupField:cf_app_id, prefix: "pgi."| lookup [fetch `dt.entity.process_group`| fields id, entity.name], sourceField:pgi.process_group_id, lookupField:id, prefix:"pg."| fields pg.id, pg.entity.name| fieldsAdd process_group = record(entityId=pg.id, displayName=pg.entity.name, dim="dt.entity.process_group")
GUID from the https://api.example.com/v3/spaces API.CF_SPACE_ID available in the process metadata. This is collected from the container VCAP_APPLICATION environment variablefetch `dt.entity.dt:cloudfoundry_space`| fields id,guid| lookup [fetch dt.entity.process_group_instance| filter matchesPhrase(softwareTechnologies, "GARDEN")| fields metadata, customPgMetadata, gardenApplicationNames, softwareTechnologies, id, entity.name, instance_of| fieldsAdd cf_space_id = arrayFirst(arrayRemoveNulls(iCollectArray(parse(metadata[], """'CLOUD_FOUNDRY_SPACE_ID:' LD:CLOUD_FOUNDRY_SPACE_ID"""))))| filter isNotNull(cf_space_id)| fieldsAdd process_group_id = instance_of[dt.entity.process_group]], sourceField: guid, lookupField:cf_space_id, prefix: "pgi."| lookup [fetch `dt.entity.process_group`| fields id, entity.name], sourceField:pgi.process_group_id, lookupField:id, prefix:"pg."| fields pg.id, pg.entity.name| fieldsAdd process_group = record(entityId=pg.id, displayName=pg.entity.name, dim="dt.entity.process_group")
When activating your extension using monitoring configuration, you can limit monitoring to one of the feature sets. To work properly, the extension has to collect at least one metric after the activation.
In highly segmented networks, feature sets can reflect the segments of your environment. Then, when you create a monitoring configuration, you can select a feature set and a corresponding ActiveGate group that can connect to this particular segment.
All metrics that aren't categorized into any feature set are considered to be the default and are always reported.
A metric inherits the feature set of a subgroup, which in turn inherits the feature set of a group. Also, the feature set defined on the metric level overrides the feature set defined on the subgroup level, which in turn overrides the feature set defined on the group level.
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Spaces | cloudfoundry.spaces.properties | Constant metric used to report CloudFoundry Spaces properties as dimensions. |
| Cloudfoundry Space resources collected as logs | cloudfoundry.spaces.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Process Instances | cloudfoundry.processes.instances | The number of instances of the process |
| CloudFoundry Process Memory Usage | cloudfoundry.processes.memory_limit | Process memory limit |
| CloudFoundry Process Disk Limit | cloudfoundry.processes.disk_limit | Process disk usage limit |
| CloudFoundry Process Log Rate Limit | cloudfoundry.processes.log_rate_limit | Process Log Rate Limit |
| Cloudfoundry Process resources collected as logs | cloudfoundry.processes.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry API Connectivity | cloudfoundry.connectivity | Cloudfoundry API successful connection percentage |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry App State | cloudfoundry.apps.state | The App state. STOPPED = 0, STARTED = 1. Use the state dimension for the string value. |
| Cloudfoundry App resources collected as logs | cloudfoundry.apps.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Routes | cloudfoundry.routes.properties | Constant metric used to report CloudFoundry Route properties as dimensions. |
| Cloudfoundry Route resources collected as logs | cloudfoundry.routes.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Org Quota Apps Total Memory Limit | cloudfoundry.organization_quotas.apps.total_memory_limit | Total memory limit for all Apps in the quota |
| CloudFoundry Org Quota Apps Per Process Memory Limit | cloudfoundry.organization_quotas.apps.per_process_memory_limit | Per process memory limit for all Apps in the quota |
| CloudFoundry Org Quota Per App Task Limit | cloudfoundry.organization_quotas.apps.per_app_tasks | Limit for the total tasks per App in the quota |
| CloudFoundry Org Quota Apps Total Instance Limit | cloudfoundry.organization_quotas.apps.total_instances | Limit for the total number of Apps in the quota |
| CloudFoundry Org Quota Apps Log Rate Limit | cloudfoundry.organization_quotas.apps.log_rate_limit | Log rate limit per App in the quota |
| CloudFoundry Org Quota Service Paid Allowed | cloudfoundry.organization_quotas.services.paid_services_allowed | The number of paid services allowed in the quota |
| CloudFoundry Org Quota Service Total Instances | cloudfoundry.organization_quotas.services.total_service_instances | The number of service instances allowed in the quota |
| CloudFoundry Org Quota Service Total keys | cloudfoundry.organization_quotas.services.total_service_keys | The number of service keys allowed in the quota |
| CloudFoundry Org Quota Routes Total | cloudfoundry.organization_quotas.routes.total_routes | The total number of routes in the quota |
| CloudFoundry Org Quota Routes Total Reserved Ports | cloudfoundry.organization_quotas.routes.total_reserved_ports | The total number of reserved ports in the quota |
| CloudFoundry Org Quota Domains Total | cloudfoundry.organization_quotas.domains.total_domains | The total number of domains allowed in the quota |
| Cloudfoundry Organization Quota resources collected as logs | cloudfoundry.organization_quotas.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Domains | cloudfoundry.domains.properties | Constant metric used to report CloudFoundry Domain properties as dimensions. |
| Cloudfoundry Domain resources collected as logs | cloudfoundry.domains.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Organizations | cloudfoundry.organizations.properties | Constant metric used to report CloudFoundry Organization properties as dimensions. |
| Cloudfoundry Organization resources collected as logs | cloudfoundry.organizations.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Service Instance Last Operation State | cloudfoundry.service_instances.last_operation.state | The Service Instance last operation state. failed = 0, in progress = 1 succeeded = 2. Use the 'state' dimension for the string value. |
| Cloudfoundry Package resources collected as logs | cloudfoundry.service_instances.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Build State | cloudfoundry.builds.state | The state of the build. FAILED = 0, STAGING = 1, STAGED = 2. Use the 'state' dimension for the string value. |
| CloudFoundry Build Staging Memory Limit | cloudfoundry.builds.staging_memory_limit | The staging memory limit for the build |
| CloudFoundry Build Staging Disk Limit | cloudfoundry.builds.staging_disk_limit | The staging disk limit for the build |
| CloudFoundry Build Staging Log Rate Limit | cloudfoundry.builds.staging_log_rate_limit | The staging log rate limit for the build |
| Cloudfoundry Build resources collected as logs | cloudfoundry.builds.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Package State | cloudfoundry.packages.state | The Package state. FAILED = 0, AWAITING_UPLOAD = 1, READY = 2. Use the 'state' dimension for the string value. |
| Cloudfoundry Package resources collected as logs | cloudfoundry.packages.logs_collected | How many resource logs were collected in the last query |
| Metric name | Metric key | Description |
|---|---|---|
| CloudFoundry Droplets | cloudfoundry.droplets.properties | Constant metric used to report CloudFoundry Droplet properties as dimensions. |
| Cloudfoundry Droplet resources collected as logs | cloudfoundry.droplets.logs_collected | How many resource logs were collected in the last query |
The amount of custom metrics will vary depending on the number of resources running in your Foundation. Total number of:
With these values, the formula for datapoints ingested by the extension is:
default which is always collected.Default: 1 (api connectivity)+Apps: 1 + (1 * number_of_apps)+Builds: 1 + (4 * number_of_builds)+Domains: 1 + (1 * number_of_domains)+Droplets: 1 + (1 * number_of_droplets)+Organizations: 1 + (1 * number_of_organizations)+Organization Quotas: 1 + (11 * number_of_org_quotas)+Packages: 1 + (1 * number_of_packages)+Processes: 1 + (4 * number_of_processes)+Routes: 1 + (1 * number_of_routes)+Service Instances: 1 + (1 * number_of_sis)+Spaces: 1 + (1 * number_of_spaces)
The result can be multiplied by 0.001 to get the amount of DDUs used per Minute or by 525600 to get the amount of datapoints used per year.
If enabled, ingested log events are simply 1 log event per Resource.
Apps, Domains, Organizations, Organization_Quotas, Routes, Service_Instances, SpacesBuilds, Droplets, Packages, Processes.