To configure Jenkins to push deployment events to Dynatrace.
Generate a new access token for the Dynatrace API.
Install the HTTP Request Plugin to your Jenkins installation.
In the Jenkins build configuration, click Add build step and select HTTP Request.
In the URL field, type in the URL of your event API endpoint:
Select POST as the HTTP mode.
Click Advanced to see all the configuration fields.
In the Headers section, select APPLICATION_JSON in the field Accept .
Select APPLICATION_JSON in the field Content-type.
Add a Custom header, type in Authorization in the Header field and Api-Token {token} in the Value field.
{"eventType": "CUSTOM_DEPLOYMENT","attachRules": {"tagRule": {"meTypes": "PROCESS_GROUP_INSTANCE","tags": "Dev"}},"deploymentName": "${JOB_NAME}","deploymentVersion": "1.1","deploymentProject": "CustomBankingService","remediationAction": "http://revertMe","ciBackLink": "${BUILD_URL}","source": "Jenkins","customProperties": {"Jenkins Build Number": "${BUILD_ID}","Git commit": "${GIT_COMMIT}"}}
${JOB_NAME}
, ${BUILD_URL}
, ${BUILD_ID}
, ${GIT_COMMIT}
are environment variables set by Jenkins during job execution.
tagRule
of the request body.