How to ingest data (events)
This guide shows you how to ingest an event in Grail via the platform/ingest/v1/events
endpoint and verify that it's persisted.
The event we will ingest is
{"name": "My first ingested event"}
Who this is for
This article is intended for development teams managing data ingestion.
Before you begin
- Dynatrace SaaS environment powered by Grail and AppEngine.
- Dynatrace Platform Subscription (DPS) license that includes Events powered by Grail.
Steps
Authenticate
The platform/ingest/v1/events
uses access token authentication. To generate an access token
- Go to Access Tokens.
- Select Generate new token.
- Enter a token name.
- Find and select the OpenPipeline – Ingest Events (
openpipeline.events
) scope. - Select Generate token.
- Select Copy and then paste the token to a secure location. It's a long string that you need to copy and paste back into Dynatrace later.
Copy the endpoint path
- Go to OpenPipeline > Events > Ingest sources.
- Find the ingest source you are interested in.
- In the Endpoints path column, select the endpoint name > Copy.
Send an event
Run the following sample command to send an event to your environment endpoint platform/ingest/v1/events
via POST
request.
The sample command indicates a JSON content type and provides the JSON event data using the -d
parameter. Make sure to substitute
<your-endpoint-URL>
with the URL of the endpoint you copied. It looks likehttps://{your-environment-id}.live.dynatrace.com/platform/ingest/v1/events
.<your-API-token>
with the token you generated.My first ingested event
with the name of your event.
curl -i -X POST "<your-endpoint-URL>" \-H "Content-Type: application/json" \-H "Authorization: Api-Token <your-API-token>" \-d "{\"name\":\"My first ingested event\"}"
Your request is successful if the output contains the 202 response code, for example
HTTP/2 202
Verify ingestion
To verify that your event has been ingested successfully, query it via DQL, for example in Notebooks.
-
Go to Notebooks.
-
Choose or create a notebook.
-
Select > DQL to add a new section with a DQL query input field.
-
Enter the following DQL query
Make sure to substitute
My first ingested event
with your event name.fetch events| filter name == "My first ingested event"
Your query is successful if the output is a record containing a timestamp, an ingest source, and a name, for example
Learn more
OpenPipeline is the unified ingestion component for the Dynatrace Platform. You can ingest various data types via APIs. To ingest records for a data type via API, you need to
- Authenticate.
- Copy the endpoint path.
- Send a record.
- Verify ingestion.
For an overview of the available endpoints, refer to Ingestion APIs.