Dynatrace Integration via webhook
Asked by Patrick Mischler:

Hello everybody,

I have tested the Dynatrace Integration of OpsGenie. It works with the v1 integration. However, when using the v2 integration via webhook (Custom webhook in dynatrace) the alerts are not generated in OpsGenie. I followed the instructions on [Integrate Opsgenie with Dynatrace Webhook (v2) \| Opsgenie \| Atlassian Support](https://support.atlassian.com/opsgenie/docs/integrate-opsgenie-with-dynatrace-webhook-v2/)

Any sugestion how I can find out what's wrong?

I use the following payload:

```
{
"State":"{State}",
"ProblemID":"{ProblemID}",
"ProblemTitle":"{ProblemTitle}",
"ImpactedEntities":{ImpactedEntities},
"ImpactedEntity":"{ImpactedEntity}",
"PID":"{PID}",
"ProblemDetailsHTML":"{ProblemDetailsHTML}",
"ProblemDetailsJSON":{ProblemDetailsJSON},
"ProblemDetailsMarkdown":"{ProblemDetailsMarkdown}",
"ProblemDetailsText":"{ProblemDetailsText}",
"ProblemImpact":"{ProblemImpact}",
"ProblemSeverity":"{ProblemSeverity}",
"ProblemURL":"{ProblemURL}",
"Tags":"{Tags}"
}
```

Sending the test notification from Dynatrace is successful:

![DT_OpsGenie_webhook_notification_test.png](https://community.atlassian.com/t5/image/serverpage/image-id/207274i526C8D2E25521853/image-size/large?v=v2&px=999 "DT_OpsGenie_webhook_notification_test.png")

Thank you very much!

Kind Regards,  
Patrick


Answers:
author: Nick H
body: Hi [@Patrick Mischler](/t5/user/viewprofilepage/user-id/4991524) ,

Some integrations / test alerts trigger through the account's Default API. Not sure if Dynatrace is one of them, but this is how Opsgenie handles some test alerts so the connection can be tested with the actual integration processing taken out of the equation, but ensures there is a connection with Opsgenie.

If you have permission to the Logs tab under the Settings menu, I'd check there to see if Opsgenie received the request from Dynatrace. If you do not have permission to the Logs tab, connect with one of your account Admins or Owners to check.

comments: author: Patrick Mischler
body: Hi Nick,

Thanks for your input. We can see the alerts in the log of OpsGenie. However, they are for some reason not assigned to the team where the integration has been configured.

![OpsGenie_Dynatrace_webhook_integration.png](https://community.atlassian.com/t5/image/serverpage/image-id/207394i96346D4AFD48DFD0/image-size/large?v=v2&px=999 "OpsGenie_Dynatrace_webhook_integration.png")

The alerts should be assigned to the team System Management but they don't. This does not happen with the "old" Dynatrace integration.

Kind Regards,  
Patrick


author: Nick H
body: Hi [@Patrick Mischler](/t5/user/viewprofilepage/user-id/4991524) ,

Like mentioned above, can you check whether or not the alert / test is being sent through the Default API?

Again - Opsgenie handles some test alerts so the connection can be tested with the actual integration processing taken out of the equation, but ensures there is a connection with Opsgenie.


author: Patrick Mischler
body: Hi Nick

Yes, I can confirm that the alerts are sent through the Default API.

We have now sent "real" alerts and they came through.

It is a bit confusing that the test-alerts are not mapped to the Team in OpsGenie but real alerts are.

Regards,  
Patrick


author: Patrick Mischler
body: And many thanks!


author: Karthikeyan Mahadevan
body: Not an expert, but recently tried that integration.   

Usually the error would be missing a Quotes or something, I know for Json we do not have to have double quotes.   
I see double quotes are missing for

```
ImpactedEntities":{ImpactedEntities},
```

can you please try with " around that ?

comments: author: Nick H
body: That's a great catch [@Karthikeyan Mahadevan](/t5/user/viewprofilepage/user-id/4978697) !


author: Patrick Mischler
body: Hi [@Karthikeyan Mahadevan](/t5/user/viewprofilepage/user-id/4978697)

I first thought so aswell. But if you look at the screenshot in the documentation, the quotes are also not there. If there are quotes arrount {ImpactedEntities} it doesn't work, because it is not a string but an array. When putting it in quotes, I get the following error in DT:

    Unexpected character ('i' (code 105)): was expecting comma to separate Object entries at [Source: (String)"{"State":"{State}","ProblemID":"{ProblemID}","ProblemTitle":"{ProblemTitle}","ImpactedEntities":"["impacted entities array example"]","ImpactedEntity":"{ImpactedEntity}","PID":"{PID}","ProblemDetailsHTML":"{ProblemDetailsHTML}","ProblemDetailsJSON":{"id":"abc"},"ProblemDetailsMarkdown":"{ProblemDetailsMarkdown}","ProblemDetailsText":"{ProblemDetailsText}","ProblemImpact":"{ProblemImpact}","ProblemSeverity":"{ProblemSeverity}","ProblemURL":"{ProblemURL}","Tags":"{Tags}"}"; line: 5, column: 24]


`Kind Regards,`  
`Patrick`


Tags: cloud

dynatrace

integration