This post will cover how to use the Dynatrace releases functionality…
- You have a Dynatrace environment available
- You have a host (or Kubernetes cluster) with a OneAgent already installed
Dynatrace Release Tracking
Using the Dynatrace release functionality is extremely easy. The method differs slightly whether you’re using a VM based deployment for your application or Kubernetes.
Fundamentally though, there are three things you must set:
- The product eg.
- The stage eg.
- The version eg.
For Kubernetes, simply add Kubernetes labels to your pods:
product value is taken from the
app.kubernetes.io/part-of label. The
version is taken from the
app.kubernetes.io/version label and the
stage is taken from either the
namespace or the Dynatrace
host group (if set).
That’s all there is to it & you’ll see releases begin to appear when new deployments are pushed.
Assuming you have a process on a VM, make the following environment variables available to the process during startup.
export DT_RELEASE_PRODUCT=<PRODUCT-NAME> export DT_RELEASE_STAGE=<STAGE-NAME> export DT_RELEASE_VERSION=<VERSION-NUMBER>
For example, to track
apache httpd releases we add these variables to
/etc/apache2/envvars and restart
echo 'export DT_RELEASE_VERSION=v0.1' | sudo tee -a /etc/apache2/envvars echo 'export DT_RELEASE_STAGE=dev' | sudo tee -a /etc/apache2/envvars echo 'export DT_RELEASE_PRODUCT=frontend' | sudo tee -a /etc/apache2/envvars sudo service apache2 restart
This is a relatively new feature in Dynatrace but is so easy to do, I now consider it a best practice.