Dynatrace automatically detects Cloud Foundry tags that are supplied via any user-provided Dynatrace Cloud Foundry service that’s bound to your application. This enables you to automatically organize and filter all monitored Cloud Foundry application components.
Please note, Cloud Foundry service-based tags work both in full-stack monitoring mode, where you use Dynatrace to monitor Cloud Foundry cluster components and applications and also when you leverage Dynatrace buildpack integrations for the monitoring of Cloud Foundry applications. However, Dynatrace buildpack integrations for Java, PHP, Staticfile, and IBM WebSphere Liberty can currently only support a single service instance that uses the name
dynatrace as a substring (see Limitations below for details). The Dynatrace Node.js buildpack integration allows you to leverage not only one, but several service instances to define Dynatrace tags.
Define Cloud Foundry service tags for multiple applications
To define Dynatrace tags, you can leverage one or more Cloud Foundry service instances that have the name
dynatrace as a substring. For example:
cf cups dynatrace-tags -p "tag:pivotal, tag:region"
You’re prompted automatically to provide values for certain tags (for example,
tag:region>eu-central-1). Dynatrace supports both Cloud Foundry labels and Cloud Foundry key-value tags. For example, the tag
pivotal in the example above is used to label all applications running within a Pivotal Cloud Foundry environment&so this tag doesn’t include a value. The key-value tag
region in the example holds the region of the AWS account that was used to deploy the Cloud Foundry environment.
You can easily update your user-provided Cloud Foundry services with new values (for example,
tag:region>eu-west-2) or additional tags:
cf uups dynatrace-tags -p "tag:pivotal, tag:region, tag:newtag"
Please note, to exploit the service instance
dynatrace-tags above, you must bind the instance to your application (for example,
cf bs spring-music dynatrace-tags
Define tags for specific Cloud Foundry applications
Additionally, Dynatrace automatically detects tags that are provided to applications via Cloud Foundry environment variables. For instance, you can provide the environment variable
DT_TAGS in the environment block of your application's manifest but you can also set
DT_TAGS using the
--- applications: - name: spring-music memory: 1G random-route: true path: build/libs/spring-music.jar services: - dynatrace-service env: DT_TAGS: hotfix
cf set-env spring-music DT_TAGS "hotfix"
Both examples above attach the tag
hotfix to all monitored processes that are related to the application
Leverage Cloud Foundry tags in your Dynatrace environment
Cloud Foundry tags are searchable via Dynatrace search. This allows you to easily find and inspect the monitoring results of related processes that are running in your Cloud Foundry environment.
Cloud Foundry tags also integrate seamlessly with Dynatrace filters. For example, you can easily filter technologies or problems using Cloud Foundry tags. You can also leverage Cloud Foundry tags when setting up fine-grained alerting profiles.
Dynatrace buildpack integrations for Java, PHP, Staticfile, and IBM WebSphere Liberty can currently only support a single service instance that uses the name
dynatrace as a substring. However, you can easily provide tags when creating this single service instance for Dynatrace:
cf cups dynatrace-service -p "environmentid, apitoken, tag:pivotal, tag:region"
If you already have a service instance for Dynatrace in place you can update it with new values or additional tags:
cf uups dynatrace-service -p "environmentid, apitoken, tag:pivotal, tag:region, tag:newtag"
For further details on creating a user-provided service for Dynatrace please see How do I monitor Cloud Foundry applications?