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

Steps

Step 1 Authenticate

The platform/ingest/v1/events uses access token authentication. To generate an access token

  1. Go to Access Tokens.
  2. Select Generate new token.
  3. Enter a token name.
  4. Find and select the OpenPipeline – Ingest Events (openpipeline.events) scope.
  5. Select Generate token.
  6. 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.

Step 2 Copy the endpoint path

  1. Go to OpenPipeline OpenPipeline app (new) > Events > Ingest sources.
  2. Find the ingest source you are interested in.
  3. In the Endpoints path column, select the endpoint name > Copy to clipboard Copy.

Step 3 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 like https://{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

Step 4 optional Verify ingestion

To verify that your event has been ingested successfully, query it via DQL, for example in Notebooks.

  1. Go to Notebooks.

  2. Choose or create a notebook.

  3. Select Add > DQL to add a new section with a DQL query input field.

  4. 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

Verify event ingest in Notebooks

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

  1. Authenticate.
  2. Copy the endpoint path.
  3. Send a record.
  4. Verify ingestion.

For an overview of the available endpoints, refer to Ingestion APIs.