cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Integrating Dynatrace with Jenkins for Deployment Events (API v2 Compatibility)

pmarchena
Observer

Hi everyone,

I'm working on integrating Dynatrace with Jenkins to send deployment events. I've found two resources:

  • Official documentation mentioning a plugin: Docs link
  • Blog post referencing a library: Blog link

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!

4 REPLIES 4

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

You can use Events API v2 - POST an event.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Hello, thanks for sharing the documentation.

I'm looking for some specific guide.

Greetings

mark_bley
Dynatrace Champion
Dynatrace Champion

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

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

Featured Posts