05 Jun 2024 08:21 PM
Hi everyone,
I'm working on integrating Dynatrace with Jenkins to send deployment events. I've found two resources:
Both resources use the Events API v1 (POST) with JSON format.
My question: can I use either the plugin or library approach with the updated Events API v2 format?
Any insights on this or recommendations for v2 integration would be greatly appreciated!
Solved! Go to Solution.
06 Jun 2024 03:06 PM
Hello, thanks for sharing the documentation.
I'm looking for some specific guide.
Greetings
06 Jun 2024 11:43 AM
You could just send the events through curl
stage('Send Event') {
steps {
script {
def response = sh(
script: """
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Api-Token ${AUTH_TOKEN}" \
-d '${PAYLOAD}' \
${DT_URL}
""",
returnStdout: true
).trim()
echo "Response: ${response}"
}
}
}
I wrote a PR for the Jenkins integration requesting the update to events v2, maybe you can reuse parts of it.
https://github.com/dynatrace-ace/dynatrace-jenkins-library/pull/15
06 Jun 2024 03:10 PM
Hello thank you very much.
Thats what Im looking for.
I'll try to reuse your code and come back to tell you how it turned out.
Greetings