Events API v2 - GET list events
Lists events that happened within the specified timeframe along with their properties.
The request produces an application/json
payload.
GET | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v2/events |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/events | |
Environment and Cluster ActiveGate (default port 9999) | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/events |
Authentication
To execute this request, you need an access token with events.read
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
nextPageKey | string | The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. | query | optional |
pageSize | integer | The amount of events in a single response payload. The maximal allowed page size is 1000. If not set, 100 is used. | query | optional |
from | string | The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two hours is used ( | query | optional |
to | string | The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. | query | optional |
eventSelector | string | Defines the scope of the query. Only events matching the specified criteria are included in the response. You can add one or several of the criteria listed below. For each criterion you can specify multiple comma-separated values, unless stated otherwise. If several values are specified, the OR logic applies.
To set several criteria, separate them with commas ( | query | optional |
entitySelector | string | The entity scope of the query. You must set one of these criteria:
You can add one or more of the following criteria. Values are case-sensitive and the
For more information, see Entity selector in Dynatrace Documentation. To set several criteria, separate them with a comma ( The maximum string length is 2,000 characters. The number of entities that can be selected is limited to 10000. | query | optional |
Response
Response codes
Code | Type | Description |
---|---|---|
200 | EventList | Success. The response contains the list of events. |
Response body objects
The EventList
object
A list of events.
Element | Type | Description |
---|---|---|
events | Event[] | A list of events. |
nextPageKey | string | The cursor for the next page of results. Has the value of Use it in the nextPageKey query parameter to obtain subsequent pages of the result. |
pageSize | integer | The number of entries per page. |
totalCount | integer | The total number of entries in the result. |
warnings | string[] | A list of warnings. |
The Event
object
Configuration of an event.
Element | Type | Description |
---|---|---|
correlationId | string | The correlation ID of the event. |
endTime | integer | The timestamp when the event was closed, in UTC milliseconds. Has the value of |
entityId | EntityStub | A short representation of a monitored entity. |
entityTags | METag[] | A list of tags of the related entity. |
eventId | string | The ID of the event. |
eventType | string | The type of the event. |
frequentEvent | boolean | If A frequent event doesn't raise a problem. |
managementZones | ManagementZone[] | A list of all management zones that the event belongs to. |
properties | EventProperty[] | A list of event properties. |
startTime | integer | The timestamp when the event was raised, in UTC milliseconds. |
status | string | The status of the event.
|
suppressAlert | boolean | The alerting status during a maintenance:
|
suppressProblem | boolean | The problem detection status during a maintenance:
|
title | string | The title of the event. |
underMaintenance | boolean | If |
The EntityStub
object
A short representation of a monitored entity.
Element | Type | Description |
---|---|---|
entityId | EntityId | A short representation of a monitored entity. |
name | string | The name of the entity. Not included in the response in case no entity with the relevant ID was found. |
The EntityId
object
A short representation of a monitored entity.
Element | Type | Description |
---|---|---|
id | string | The ID of the entity. |
type | string | The type of the entity. |
The METag
object
The tag of a monitored entity.
Element | Type | Description |
---|---|---|
context | string | The origin of the tag, such as AWS or Cloud Foundry. Custom tags use the |
key | string | The key of the tag. |
stringRepresentation | string | The string representation of the tag. |
value | string | The value of the tag. |
The ManagementZone
object
A short representation of a management zone.
Element | Type | Description |
---|---|---|
id | string | The ID of the management zone. |
name | string | The name of the management zone. |
The EventProperty
object
A property of an event.
Element | Type | Description |
---|---|---|
key | string | The key of the event property. |
value | string | The value of the event property. |
Response body JSON model
1{2 "events": [3 {4 "correlationId": "933613657e1c8fcf",5 "endTime": 1564039524182,6 "entityId": {7 "entityId": {8 "id": "string",9 "type": "string"10 },11 "name": "string"12 },13 "entityTags": [14 {15 "context": "string",16 "key": "string",17 "stringRepresentation": "string",18 "value": "string"19 }20 ],21 "eventId": "4293884258445543163_1564039524182",22 "eventType": "LOW_DISK_SPACE",23 "frequentEvent": true,24 "managementZones": [25 {26 "id": "string",27 "name": "string"28 }29 ],30 "properties": [31 {32 "key": "string",33 "value": "string"34 }35 ],36 "startTime": 1564039524182,37 "status": "OPEN",38 "suppressAlert": true,39 "suppressProblem": true,40 "title": "High CPU load on host X",41 "underMaintenance": true42 }43 ],44 "nextPageKey": "AQAAABQBAAAABQ==",45 "pageSize": 1,46 "totalCount": 1,47 "warnings": [48 "string"49 ]50}
Example
In this example, the request lists all events of the PROCESS_RESTART (eventSelector=eventType("PROCESS_RESTART")
) that happened within the last 2 hours (from=now-2h
) while a maintenance window was active (eventSelector=underMaintenance(true)
). The result is truncated to two events.
The API token is passed in the Authorization header.
Curl
1curl --request GET \2 --url 'https://mySampleEnv.live.dynatrace.com/api/v2/events?eventSelector=eventType(%22PROCESS_RESTART%22)%2CunderMaintenance(true)&from=now-2h' \3 --header 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'
Request URL
1https://mySampleEnv.live.dynatrace.com/api/v2/events?eventSelector=eventType(%22PROCESS_RESTART%22)%2CunderMaintenance(true)&from=now-2h
Response body
1{2 "totalCount": 43,3 "pageSize": 100,4 "events": [5 {6 "eventId": "-6475311485380369979_1628500180000",7 "startTime": 1628500180000,8 "endTime": 1628500240000,9 "eventType": "PROCESS_RESTART",10 "title": "Process restart",11 "entityId": {12 "entityId": {13 "id": "PROCESS_GROUP_INSTANCE-03F98EA8639FD052",14 "type": "PROCESS_GROUP_INSTANCE"15 },16 "name": "IIS app pool dotNetFrontend_easyTravel_x64"17 },18 "properties": [19 {20 "key": "dt.event.group_label",21 "value": "Process restart"22 }23 ],24 "status": "OPEN",25 "entityTags": [26 {27 "context": "CONTEXTLESS",28 "key": "easyTravel",29 "stringRepresentation": "easyTravel"30 },31 {32 "context": "CONTEXTLESS",33 "key": "tech",34 "value": "IIS",35 "stringRepresentation": "tech:IIS"36 },37 {38 "context": "CONTEXTLESS",39 "key": "tech",40 "value": ".NET",41 "stringRepresentation": "tech:.NET"42 },43 {44 "context": "CONTEXTLESS",45 "key": "hosts",46 "value": "w-077",47 "stringRepresentation": "hosts:w-077"48 },49 {50 "context": "CONTEXTLESS",51 "key": "Infrastructure",52 "value": "Windows",53 "stringRepresentation": "Infrastructure:Windows"54 },55 {56 "context": "CONTEXTLESS",57 "key": "dotNetFrontend",58 "stringRepresentation": "dotNetFrontend"59 },60 ],61 "managementZones": [62 {63 "id": "9130632296508575249",64 "name": "Easytravel"65 },66 {67 "id": "-6239538939987181652",68 "name": "frontend"69 },70 {71 "id": "5130731705740636866",72 "name": "Windows"73 }74 ],75 "underMaintenance": true,76 "suppressAlert": true,77 "suppressProblem": true,78 "frequentEvent": false79 },80 {81 "eventId": "-231290298591263162_1628500000000",82 "startTime": 1628500000000,83 "endTime": 1628500060000,84 "eventType": "PROCESS_RESTART",85 "title": "Process restart",86 "entityId": {87 "entityId": {88 "id": "PROCESS_GROUP_INSTANCE-00CA9B0F1AE9BAF8",89 "type": "PROCESS_GROUP_INSTANCE"90 },91 "name": "chromedriver_linux64"92 },93 "properties": [94 {95 "key": "dt.event.group_label",96 "value": "Process restart"97 }98 ],99 "status": "CLOSED",100 "entityTags": [101 {102 "context": "CONTEXTLESS",103 "key": "Infrastructure",104 "value": "Linux",105 "stringRepresentation": "Infrastructure:Linux"106 },107 {108 "context": "CONTEXTLESS",109 "key": "hosts",110 "value": "l-008",111 "stringRepresentation": "hosts:l-008"112 }113 ],114 "managementZones": [115 {116 "id": "2631544906797876001",117 "name": "Linux"118 }119 ],120 "underMaintenance": true,121 "suppressAlert": false,122 "suppressProblem": false,123 "frequentEvent": false124 }125 ],126 "warnings": []127}
Response code
200