03 Jun 2019 04:27 PM
I am currently working on pushing alerts coming out of PingPlotter to Dynatrace SaaS. What I would like to do is create a "PERFORMANCE_EVENT" in Dynatrace when an alert is generated in PingPlotter. This is what I have so far...
{
"eventType": "PERFORMANCE_EVENT",
"description": "string",
"title": "string",
"source": "string",
"timeoutMinutes": "60",
"attachRules": {
"tagRule": [
{
"meTypes": "APPLICATION",
"tags": [
{
"context": "ENVIRONMENT",
"key": "customTag"
}
]
}
]
},
"host": "${Host}",
"alertName": "${AlertName}",
"destinationHost": "${DestinationHost}"
}
When I test the API, I'm getting...
{ "error": { "code": 400, "message": "Invalid attachRules object provided. No MEIdentifier do match: Matching rule: PushEventAttachRules{entityIds=null, tagRules=[TagMatchRule{meTypes=[APPLICATION], tags=[[ENVIRONMENT]customTag]}]}" }
}
I have gone through the documentation multiple times!
Help!!
Solved! Go to Solution.
03 Jun 2019 04:55 PM
New file...same problem. I've walked through the API model.
Bad request error - { "error": { "code": 400, "message": "Invalid attachRules object provided. No MEIdentifier do match: Matching rule: PushEventAttachRules{entityIds=null, tagRules=[TagMatchRule{meTypes=[APPLICATION], tags=[[CONTEXTLESS]customTag]}]}" }
}
04 Jun 2019 06:29 AM
I think you have to specify the tags key in a 'key' field as shown below:
{
"eventType": "ERROR_EVENT",
"title" : "Power outage",
"description" : "UPS detected a power outage",
"timeoutMinutes" : 60,
"attachRules": {
"entityIds":[],
"tagRule":[{
"meTypes" : [ "HOST" ],
"tags" : [ { "context" : "CONTEXTLESS", "key" : "clinic" } ]
}]
},
"source":"UPS-123 (Datacenter South)",
"customProperties":
{
"PowerLevel": "20.000Ah",
"Estimation": "3 hours",
"UPS-Model": "APC Smart-UPS C 1000VA, USB"
}
}
I will review our help doc to provide better examples on that.
10 Oct 2019 09:45 PM
Was wondering, is this issue resolved yet?
31 Aug 2020 12:20 PM
Hi All,
I have the same issue, and i have tried the proposed example and received the same issue
Request
https://myenvironment/e/1c73bd17-f3f1-4c29-af69-f2447189a9c3/api/v1/events \
-H 'Authorization: Api-token mytoken' \
-H 'Content-Type: application/json' \
-d '{
"eventType": "ERROR_EVENT",
"title" : "Power outage",
"description" : "UPS detected a power outage",
"timeoutMinutes" : 60,
"attachRules": {
"entityIds":[],
"tagRule":[{
"meTypes" : [ "HOST" ],
"tags" : [ { "context" : "CONTEXTLESS", "key" : "clinic" } ]}
]},
"source":"UPS-123 (Datacenter South)",
"customProperties":{
"PowerLevel": "20.000Ah",
"Estimation": "3 hours",
"UPS-Model": "APC Smart-UPS C 1000VA, USB"}
}
Error received:
"code":400,"message":"Invalid attachRules object provided. No MEIdentifier do match: Matching rule: PushEventAttachRules{entityIds=[], tagRules=[TagMatchRule{meTypes=[HOST], tags=[[CONTEXTLESS]clinic]}]}"}}
Thanks,
Ahmed