Events API v1 has been deprecated with Dynatrace version 1.243. Its replacement is Events API v2. We recommend that you migrate to the new API at your earliest convenience.
The migration affects endpoint URLs, query parameters, and response/request body parameters, as well as the scope of the token for request authentication.
Events API v2 offers you the following new features:
The ingestion of custom events consumes Davis Data Units (DDUs) from the events pool.
/api/v2/events
/api/v1/events
events.read
)events.ingest
)DataExport
)To learn about new query/body parameters, see the documentation of individual requests in Events API v2.
Here are some examples of differences in API usage.
In this example, we query a list of open availability events on hosts that happened within the last two hours.
GET https://mySampleEnv.live.dynatrace.com/api/v2/events?eventSelector=eventType("AVAILABILITY_EVENT"),status("OPEN")&from=now-2h&entitySelector=type("HOST")
{"totalCount": 28,"pageSize": 2,"nextPageKey": "AQANMTY2OTY0NDE2NjAwOQEADTE2Njk2NTEzNjYwMDkBADtTdHJpbmcoVDFCRlRnPT0pLUxvbmcoMTg0YmVlMjU1NjkpLUxvbmcoYTdjZjQ2NjZlNjIwZjMyMSktMgEAAAACAQAuZXZlbnRUeXBlKCJBVkFJTEFCSUxJVFlfRVZFTlQiKSxzdGF0dXMoIk9QRU4iKQEADHR5cGUoIkhPU1QiKQA=","events": [{"eventId": "-9195326388738983252_1669651221408","startTime": 1669651221408,"endTime": -1,"eventType": "AVAILABILITY_EVENT","title": "No process found for rule Oracle listener","entityId": {"entityId": {"id": "HOST-E371A974A078CC54","type": "HOST"},"name": "frontend-dev"},"properties": [{"key": "Event source","value": "Process availability"},{"key": "Message","value": "Missing process matching rule named Oracle listener"},{"key": "custom.message-process-av","value": "The {dt.event.title} is on deployment version: {dt.event.deployment.version}"},{"key": "dt.event.group_label","value": "Availability event"},{"key": "dt.event.impact_level","value": "Infrastructure"},{"key": "dt.event.is_rootcause_relevant","value": "true"},{"key": "dt.event.timeout","value": "4"},{"key": "dt.event.title","value": "No process found for rule Oracle listener"}],"status": "OPEN","correlationId": "458a73c38677f1ac","entityTags": [{"context": "CONTEXTLESS","key": "frontend","stringRepresentation": "frontend"},{"context": "CONTEXTLESS","key": "stage","value": "dev","stringRepresentation": "stage:dev"}],"managementZones": [{"id": "6143976176513989654","name": "Infrastructure Linux"},{"id": "4067143719293196613","name": "dev"},{"id": "-6114370715062110014","name": "frontent"}],"underMaintenance": false,"suppressAlert": false,"suppressProblem": false,"frequentEvent": false},{"eventId": "-6354783141434952927_1669649814889","startTime": 1669649814889,"endTime": -1,"eventType": "AVAILABILITY_EVENT","title": "Host unavailable","entityId": {"entityId": {"id": "HOST-FD01FA52FB10B433","type": "HOST"},"name": "GDNVTUBU2004-1"},"properties": [{"key": "dt.event.group_label","value": "Availability event"},{"key": "dt.event.impact_level","value": "Infrastructure"},{"key": "dt.event.is_rootcause_relevant","value": "true"},{"key": "dt.event.timeout","value": "5"},{"key": "dt.event.title","value": "Host unavailable"}],"status": "OPEN","correlationId": "360ad37a6f4de7d0","entityTags": [{"context": "CONTEXTLESS","key": "OS","value": "Linux","stringRepresentation": "OS:Linux"}],"managementZones": [{"id": "6143976176513989654","name": "Linux"},{"id": "4067143719293196613","name": "dev"}],"underMaintenance": false,"suppressAlert": false,"suppressProblem": false,"frequentEvent": false}],"warnings": []}
In this example, we ingest a custom info event affecting all hosts whose hostname begins with prod
.
POST https://mySampleEnv.live.dynatrace.com/api/v2/events
{"eventType": "AVAILABILITY_EVENT","title": "Critical service outage","timeout": 30,"entitySelector": "type(HOST),entityName.startsWith(prod)","allowDavisMerge": false,"properties": {"custom property 1": "my property value 1","custom property 2": "my property value 2"}}