Integrating IBM UrbanCode Deploy with Dynatrace
Overview
The purpose of this document is to try and show how one could integrate IBM UrbanCode Deploy (now IBM DevOps Deploy) with Dynatrace for improved observability for clients that are using both products today.
You will see in this document that IBM UrbanCode Deploy (UCD) can send a Dynatrace a “deployment event” at the time of deployment and pass along some meta-data that is useful for the operator to see when correlating events and important metrics in the Dynatrace solution.
There are some nice benefits to consider when integrating the two solutions. These include:
- Visibility of the IBM UrbanCode Deploy pipeline and the deployment executed within Dynatrace.
- Nice traceability in Dynatrace back to IBM UrbanCode Deploy, the build, and more.
- You could automate the installation of new Dynatrace Agents with the IBM UrbanCode Deploy solution.
How to Setup the UCD and Dynatrace Integration
In order to setup this integration, you will need to follow these steps:
- In Dynatrace, generate an access token for the Dynatrace API. In UCD, we can create a “secure” property with this value.
- In UrbanCode Deploy, install the “Web Utilities” plugin which can be used to make an HTTP POST request to Dynatrace.
- Obtain the Dynatrace events URL for your API endpoint. These are examples:
- Managed - https://{your-domain}/e/{your-environment-id}/api/v1/events/
- SaaS - https://{your-environment-id}.live.dynatrace.com/api/v1/events/
- Environment ActiveGate - https://{your-activegate-domain}/e/{your-environment-id}/api/v1/events
- In your UCD component process for deployment, add a step to the process by following these directions:
- In the process visual design view, drag and drop the “Send HTTP Call” step (found under Web Utilities) into your process.
- Name the process “Send Dynatrace a Deployment Event”
- Click the pencil icon for the step
- In the URL property, add the URL to your Dynatrace API endpoint (see step 2 above)
- For the HTTP Method pulldown, select “POST”
- In the Headers, field, add the following:
- In the Data / Data File field, add the following:
-
{
"eventType": "CUSTOM_DEPLOYMENT",
"attachRules": {
"tagRule": {
"meTypes": "PROCESS_GROUP_INSTANCE",
"tags": "${p:environment.name}"
}
},
"deploymentName": "${p:applicationProcess.name}",
"deploymentVersion": "${p:componentVersion.name}",
"deploymentProject": "${p:application.name}",
"remediationAction": "Deploy the previous component version",
"ciBackLink": "${p:server.url}/#applicationProcessRequest/${p:request.id}”,
"source": "IBM UrbanCode Deploy",
"customProperties": {
"Component Name”: “${p:component.name},
“Component Version Number": "${p:componentVersion.name}"
}
}
NOTE: for the custom properties, you can add a build number, git commit hash, or other custom data that would be relevant.
- Leave the other fields with the default values. Scroll down and click the OK button.
- Save your UCD component process by clicking the Save button.
Example from IBM UrbanCode Deploy
Here are some screen shots from my IBM UrbanCode Deploy instance. I created a component named “Dynatrace-Example” and created a process as shown below:
Notice that I used the “Send HTTP Call” step and dragged it over into my visual design.
Here you can see the step details:
The “Headers” information must be set as we detailed above. Here is my example:
Finally, the “Data / Data File” field should also be set. Here is my example:
What you see in the Dynatrace Console
When you send the deployment event to Dynatrace as shown above, you will see something like this:
In the example above, you can see a custom deployment event with user-defined key-value properties. This is helpful for IBM UrbanCode Deploy to report important context information to the operator using Dynatrace.
Reference Material
Please refer to these Dynatrace documentation links that provide further details.
#UrbanCodeDeploy
#dynatrace