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 | Managed | https://{your-domain}/e/{your-environment-id}/api/v2/events |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/events | |
Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/v2/events |
Authentication
To execute this request, you need an access token with Read events (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 several 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 ( Supported 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 | Event | Success. The response contains the list of events. |
Response body objects
The EventList
object
A list of events.
Element | Type | Description |
---|---|---|
warnings | string[] | A list of warnings. Can be |
events | Event[] | A list of events. Can be |
pageSize | integer | The number of entries per page. Can be |
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. Can be |
totalCount | integer | The total number of entries in the result. |
The Event
object
Configuration of an event.
Element | Type | Description |
---|---|---|
managementZones | Management | A list of all management zones that the event belongs to. Can be |
underMaintenance | boolean | If Can be |
suppressAlert | boolean | The alerting status during a maintenance:
Can be |
suppressProblem | boolean | The problem detection status during a maintenance:
Can be |
frequentEvent | boolean | If A frequent event doesn't raise a problem. Can be |
entityId | Entity | A short representation of a monitored entity. Can be |
eventId | string | The ID of the event. Can be |
entityTags | M | A list of tags of the related entity. Can be |
eventType | string | The type of the event. Can be |
properties | Event | A list of event properties. Can be |
status | string | The status of the event. Can be |
startTime | integer | The timestamp when the event was raised, in UTC milliseconds. Can be |
endTime | integer | The timestamp when the event was closed, in UTC milliseconds. Has the value of Can be |
title | string | The title of the event. Can be |
correlationId | string | The correlation ID of the event. Can be |
The ManagementZone
object
A short representation of a management zone.
Element | Type | Description |
---|---|---|
name | string | The name of the management zone. Can be |
id | string | The ID of the management zone. Can be |
The EntityStub
object
A short representation of a monitored entity.
Element | Type | Description |
---|---|---|
entityId | Entity | A short representation of a monitored entity. Can be |
name | string | The name of the entity. Not included in the response in case no entity with the relevant ID was found. Can be |
The EntityId
object
A short representation of a monitored entity.
Element | Type | Description |
---|---|---|
id | string | The ID of the entity. Can be |
type | string | The type of the entity. Can be |
The METag
object
The tag of a monitored entity.
Element | Type | Description |
---|---|---|
stringRepresentation | string | The string representation of the tag. Can be |
value | string | The value of the tag. Can be |
key | string | The key of the tag. Can be |
context | string | The origin of the tag, such as AWS or Cloud Foundry. Custom tags use the Can be |
The EventProperty
object
A property of an event.
Element | Type | Description |
---|---|---|
value | string | The value of the event property. Can be |
key | string | The key of the event property. Can be |
Response body JSON model
{
"warnings": [
"string"
],
"events": [
{
"managementZones": [
{
"name": "string",
"id": "string"
}
],
"underMaintenance": true,
"suppressAlert": true,
"suppressProblem": true,
"frequentEvent": true,
"entityId": {
"entityId": {
"id": "string",
"type": "string"
},
"name": "string"
},
"eventId": "4293884258445543163_1564039524182",
"entityTags": [
{
"stringRepresentation": "string",
"value": "string",
"key": "string",
"context": "string"
}
],
"eventType": "LOW_DISK_SPACE",
"properties": [
{
"value": "string",
"key": "string"
}
],
"status": "OPEN",
"startTime": 1564039524182,
"endTime": 1564039524182,
"title": "High CPU load on host X",
"correlationId": "933613657e1c8fcf"
}
],
"pageSize": 1,
"nextPageKey": "AQAAABQBAAAABQ==",
"totalCount": 1
}
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
curl --request GET \
--url 'https://mySampleEnv.live.dynatrace.com/api/v2/events?eventSelector=eventType(%22PROCESS_RESTART%22)%2CunderMaintenance(true)&from=now-2h' \
--header 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'
Request URL
https://mySampleEnv.live.dynatrace.com/api/v2/events?eventSelector=eventType(%22PROCESS_RESTART%22)%2CunderMaintenance(true)&from=now-2h
Response body
{
"totalCount": 43,
"pageSize": 100,
"events": [
{
"eventId": "-6475311485380369979_1628500180000",
"startTime": 1628500180000,
"endTime": 1628500240000,
"eventType": "PROCESS_RESTART",
"title": "Process restart",
"entityId": {
"entityId": {
"id": "PROCESS_GROUP_INSTANCE-03F98EA8639FD052",
"type": "PROCESS_GROUP_INSTANCE"
},
"name": "IIS app pool dotNetFrontend_easyTravel_x64"
},
"properties": [
{
"key": "dt.event.group_label",
"value": "Process restart"
}
],
"status": "OPEN",
"entityTags": [
{
"context": "CONTEXTLESS",
"key": "easyTravel",
"stringRepresentation": "easyTravel"
},
{
"context": "CONTEXTLESS",
"key": "tech",
"value": "IIS",
"stringRepresentation": "tech:IIS"
},
{
"context": "CONTEXTLESS",
"key": "tech",
"value": ".NET",
"stringRepresentation": "tech:.NET"
},
{
"context": "CONTEXTLESS",
"key": "hosts",
"value": "w-077",
"stringRepresentation": "hosts:w-077"
},
{
"context": "CONTEXTLESS",
"key": "Infrastructure",
"value": "Windows",
"stringRepresentation": "Infrastructure:Windows"
},
{
"context": "CONTEXTLESS",
"key": "dotNetFrontend",
"stringRepresentation": "dotNetFrontend"
},
],
"managementZones": [
{
"id": "9130632296508575249",
"name": "Easytravel"
},
{
"id": "-6239538939987181652",
"name": "frontend"
},
{
"id": "5130731705740636866",
"name": "Windows"
}
],
"underMaintenance": true,
"suppressAlert": true,
"suppressProblem": true,
"frequentEvent": false
},
{
"eventId": "-231290298591263162_1628500000000",
"startTime": 1628500000000,
"endTime": 1628500060000,
"eventType": "PROCESS_RESTART",
"title": "Process restart",
"entityId": {
"entityId": {
"id": "PROCESS_GROUP_INSTANCE-00CA9B0F1AE9BAF8",
"type": "PROCESS_GROUP_INSTANCE"
},
"name": "chromedriver_linux64"
},
"properties": [
{
"key": "dt.event.group_label",
"value": "Process restart"
}
],
"status": "CLOSED",
"entityTags": [
{
"context": "CONTEXTLESS",
"key": "Infrastructure",
"value": "Linux",
"stringRepresentation": "Infrastructure:Linux"
},
{
"context": "CONTEXTLESS",
"key": "hosts",
"value": "l-008",
"stringRepresentation": "hosts:l-008"
}
],
"managementZones": [
{
"id": "2631544906797876001",
"name": "Linux"
}
],
"underMaintenance": true,
"suppressAlert": false,
"suppressProblem": false,
"frequentEvent": false
}
],
"warnings": []
}
Response code
200