This API is deprecated. Use the Events API v2 instead.
Lists all of your environment's events and their parameters. Because the possible number of events can be large, the response is limited to 150 events. You can narrow down the output by specifying filtering parameters in your request.
The request produces an application/json
payload.
GET | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v1/events |
Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/v1/events |
To execute this request, you need an access token with DataExport
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
from | integer | Start timestamp of the query, in UTC milliseconds. If not set, 30 days ago from now is used, unless relativeTime is set. | query | optional |
to | integer | End timestamp of the query, in UTC milliseconds. If not set, the current timestamp is used, unless relativeTime is set. The timeframe must not exceed 2 years. | query | optional |
relativeTime | string | Relative timeframe, back from the current time.
| query | optional |
eventType | string | Filters the resulting set of events by the event type.
| query | optional |
entityId | string | Filters the resulting set of events to the events, related to the specified Dynatrace entity. | query | optional |
cursor | string | The response is limited to 150 events, so if you want to receive more you can use the cursor to get the next 150. This parameter should be empty when querying for the first time. The cursor key can then be found in the nextCursor field of the previous response. When using the cursor string, it is not necessary to specify the additional parameters, as that info is already encoded within the cursor. | query | optional |
Each event contains at least the following meta information elements and event-specific properties.
Code | Type | Description |
---|---|---|
200 | Event | Success |
4XX | Error | Client side error. |
5XX | Error | Server side error. |
EventQueryResult
objectEvents of the environment.
Element | Type | Description |
---|---|---|
events | Event | The list of events. |
from | integer | Start of the query timeframe. |
nextCursor | string | The cursor for the next 150 events, fitting the specified criteria. Set this value for the cursor query parameter. Without it you'll get the first 150 events again. You don't have to specify any additional parameters, because the cursor already contains all of them. |
to | integer | End of the query timeframe. |
totalEventCount | integer | The total amount of events, fitting the specified criteria. |
EventRestEntry
objectSet of parameters of the event.
Apart from the general properties mentioned here, which each event has, an actual event has a set of metadata that varies depending on the event type.
Element | Type | Description |
---|---|---|
endTime | integer | The timestamp of the event closure, in UTC milliseconds |
entityId | string | The ID of the affected Dynatrace entity. |
entityName | string | The name of the affected Dynatrace entity. |
eventStatus | string | The state of the event: open or closed.
|
eventType | string | The type of the event.
|
id | string | The encoded ID of the event. The format is eventID_startTime. You should use the value from this field when you need an event ID. |
impactLevel | string | The impact level of the event. It shows what is affected by the problem: infrastructure, service, or application.
|
resourceId | string | The id of the resource the event occurred on. |
resourceName | string | The name of the resource the event occurred on. |
severityLevel | string | The severity of the event.
|
startTime | integer | The timestamp of the event detection, in UTC milliseconds. |
tags | Tag | Tags of the Dynatrace entity that raised the event. |
TagInfo
objectTag of a Dynatrace 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. Custom tags have the tag value here. |
value | string | The value of the tag. Not applicable to custom tags. |
{"events": [{"endTime": 1521542929000,"entityId": "HOST-0000000000000007","entityName": "Example Host","eventStatus": "OPEN","eventType": "SLOW_DISK","id": "5915682011263205071_1521042929000","impactLevel": "INFRASTRUCTURE","severityLevel": "PERFORMANCE","source": "builtin","startTime": 1521042929000,"tags": [{"context": "CONTEXTLESS","key": "exampleTag"}]},{"endTime": 1521542929000,"entityId": "HOST-0000000000000007","entityName": "Example Host","eventStatus": "OPEN","eventType": "SLOW_DISK","id": "5915682011263205071_1521042929000","impactLevel": "INFRASTRUCTURE","severityLevel": "PERFORMANCE","source": "builtin","startTime": 1521042929000,"tags": [{"context": "CONTEXTLESS","key": "exampleTag"}]}],"from": 1521042929000,"nextCursor": "AgEBAAFn5IIFrgEAAAFofwDTrgAAAQAcMTY4N2RhYzViZTAtZmUxODEwOWQ5YTA1MTIyNQ%3D%3D","to": 1521542929000,"totalEventCount": 2}
In this example, the request queries all the ERROR_EVENT events that occurred during the last 24 hours. The result is truncated to two events.
The API token is passed in the Authorization header.
curl -X GET \'https://mySampleEnv.live.dynatrace.com/api/v1/events?eventType=ERROR_EVENT&relativeTime=day' \-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'
https://mySampleEnv.live.dynatrace.com/api/v1/events?eventType=ERROR_EVENT&relativeTime=day
{"nextEventStartTms": null,"nextEventId": null,"nextCursor": null,"from": 1530703635653,"to": 1533295635653,"totalEventCount": 25,"events": [{"eventId": -8338439733889003014,"startTime": 1532328338475,"endTime": 1532328638475,"entityId": "HOST-E4D1E5F46E239F21","entityName": "l-8.dyna.trace","severityLevel": "ERROR","impactLevel": "INFRASTRUCTURE","eventType": "ERROR_EVENT","eventStatus": "CLOSED","tags": [{"context": "CONTEXTLESS","key": "deploy"},{"context": "CONTEXTLESS","key": "room23"}],"id": "-8338439733889003014_1532328338475","annotationDescription": "testTrigger","correlationId": "67da0a4293956e55","source": "restTest"},{"eventId": 3092227520312561338,"startTime": 1531832640600,"endTime": 1531836240600,"entityId": "HOST-CE6A2253598EA88D","entityName": "q2.docker.l5","severityLevel": "ERROR","impactLevel": "INFRASTRUCTURE","eventType": "ERROR_EVENT","eventStatus": "CLOSED","tags": [{"context": "CONTEXTLESS","key": "ServiceNow"}],"id": "3092227520312561338_1531832640600","customProperties": {"Property 2": "value 2","Property 1": "value 1","Property 3": "value 3"},"annotationDescription": "package is damaged","correlationId": "1b79973c6902b486","source": "myAPI"}]}
200