UrbanCode

 View Only

Integrating IBM UrbanCode Deploy with Dynatrace

By Randall Langehennig posted 13 days ago

  

Integrating IBM UrbanCode Deploy with Dynatrace

 Overview

The purpose of this document is to try and show how one could integrate IBM UrbanCode Deploy (UCD) with Dynatrace for improved observability for clients that are using both products today.

You will see in this document that IBM UrbanCode Deploy 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:

  1. In Dynatrace, generate an access token for the Dynatrace API. In UCD, we can create a “secure” property with this value.

 

  1. In UrbanCode Deploy, install the “Web Utilities” plugin which can be used to make an HTTP POST request to Dynatrace.

 

  1. Obtain the Dynatrace events URL for your API endpoint. These are examples:
    1. Managed - https://{your-domain}/e/{your-environment-id}/api/v1/events/
    2. SaaS - https://{your-environment-id}.live.dynatrace.com/api/v1/events/
    3. Environment ActiveGate - https://{your-activegate-domain}/e/{your-environment-id}/api/v1/events

 

  1. In your UCD component process for deployment, add a step to the process by following these directions:
    1. In the process visual design view, drag and drop the “Send HTTP Call” step (found under Web Utilities) into your process.
    2. Name the process “Send Dynatrace a Deployment Event”
    3. Click the pencil icon for the step
    4. In the URL property, add the URL to your Dynatrace API endpoint (see step 2 above)
    5. For the HTTP Method pulldown, select “POST”
    6. In the Headers, field, add the following:
      •    accept: application/json

           content-type: application/json

           Authorization: apiToken ${p:dynatrace_apiToken}
    7. 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.

    8. Leave the other fields with the default values.   Scroll down and click the OK button.
    9. 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. 

    Permalink