Ingests a custom event to Dynatrace.
The request consumes an application/json
payload.
The ingestion of custom events consumes Davis Data Units (DDUs) from the events pool.
POST | SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/events/ingest |
Environment ActiveGateCluster ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/events/ingest |
To execute this request, you need an access token with events.ingest
scope.
To learn how to obtain and use it, see Tokens and authentication.
EventIngest
objectThe configuration of an event to be ingested.
The end time of the event, in UTC milliseconds.
If not set, the start time plus timeout is used.
The entity selector, defining a set of Dynatrace entities to be associated with the event.
Only entities that have been active within the last 24 hours can be selected.
If not set, the event is associated with the environment (dt.entity.environment
) entity.
The type of the event.
AVAILABILITY_EVENT
CUSTOM_ALERT
CUSTOM_ANNOTATION
CUSTOM_CONFIGURATION
CUSTOM_DEPLOYMENT
CUSTOM_INFO
ERROR_EVENT
MARKED_FOR_TERMINATION
PERFORMANCE_EVENT
RESOURCE_CONTENTION_EVENT
A map of event properties.
dt.event.*
and dt.davis.*
properties. To check which properties belong to classic API, see Events API v2 - GET all event properties.dt.entity.*
keys.dt.*
namespace.Values of event properties with predefined behavior must fulfill the requirements of the respective property.
A maximum of 100 properties can be specified. A property key is allowed to contain up to 100 characters. A property value is allowed to contain up to 4096 characters.
The start time of the event, in UTC milliseconds.
If not set, the current timestamp is used.
Depending on the event type, the start time must not lie in the past more than 6 hours for problem-opening events and 30 days for info events.
Depending on the event type, the start time must not lie in the future more than 5 minutes for problem-opening events and 7 days for info events.
Events that can be sent up to 7 days in the future:
CUSTOM_ANNOTATION
CUSTOM_CONFIGURATION
CUSTOM_DEPLOYMENT
CUSTOM_INFO
MARKED_FOR_TERMINATION
The timeout of the event, in minutes.
If not set, 15 is used.
The timeout will automatically be capped to a maximum of 360 minutes (6 hours).
Problem-opening events can be refreshed and therefore kept open by sending the same payload again.
The title of the event.
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"endTime": 1,"entitySelector": "string","eventType": "AVAILABILITY_EVENT","properties": {},"startTime": 1,"timeout": 1,"title": "string"}
The event ingest request was received by the server. The response body indicates for each event whether its creation was successful.
EventIngestResults
objectThe results of an event ingest.
The number of created event reports.
EventIngestResult
objectThe result of a created event report.
The correlation ID of the created event.
The status of the ingestion.
INVALID_ENTITY_TYPE
INVALID_METADATA
INVALID_TIMESTAMPS
OK
{"eventIngestResults": [{"correlationId": "string","status": "INVALID_ENTITY_TYPE"}],"reportCount": 1}
An operations team wants to push a Marked for termination event to all the hosts that are planned to be removed. They also want to include the purpose for the deletion and a job identifier. The hosts to be removed are gathered in a designated host group.
In this example, the request sends a Marked for termination event to hosts that are planned to be removed. Such hosts are identified by the cloud-burst-hosts host group. The event automatically applies to all hosts that are part of the group. The purpose for termination and automation job number are provided as additional information.
The API token is passed in the Authorization header.
curl --request POST \--url https://mySampleEnv.live.dynatrace.com/api/v2/events/ingest \--header 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \--header 'Content-Type: application/json' \--data '{"eventType": "MARKED_FOR_TERMINATION","title": "Planned host downscale","entitySelector": "type(HOST),fromRelationship.isInstanceOf(type(HOST_GROUP),entityName(cloud-burst-hosts))","properties": {"job.number": "21234346"}}'
https://mySampleEnv.live.dynatrace.com/api/v2/events/ingest
{"eventType": "MARKED_FOR_TERMINATION","title": "Planned host downscale","entitySelector": "type(HOST),fromRelationship.isInstanceOf(type(HOST_GROUP),entityName(cloud-burst-hosts))","properties": {"job.number": "21234346"}}
{"reportCount": 2,"eventIngestResults": [{"correlationId": "41f5d263011a6c9a","status": "OK"},{"correlationId": "80eae4d163cc5760","status": "OK"}]}
201