Event Streaming Metrics Summary API

Use the Event Streaming Metrics API to monitor delivery metrics for your event streams.

Authentication

This API uses basic authentication, using the API key and secret key for your project. Pass base64-encoded credentials in the request header like {api-key}:{secret-key}. api-key replaces username, and secret-key replaces the password.

Your authorization header should look something like this:

--header 'Authorization: Basic YWhhbWwsdG9uQGFwaWdlZS5jb206bClwYXNzdzByZAo'`

For more information, see Find your API Credentials

Endpoints

Region Endpoint
Standard server https://amplitude.com/api/2/event-streaming/delivery-metrics-summary
EU residency server https://analytics.eu.amplitude.com/api/2/event-streaming/delivery-metrics-summary

Considerations

  • The latest 4 hours of data is accurate to the minute. Beyond that, the data is aggregated internally for every hour. Consider this when requesting metric data older than 4 hours.
  • Amplitude retains event streaming metrics for the last 90 days. Sending start or end time beyond this threshold returns a 500 status.

Limits

The API has a limit of 4 concurrent requests per project, and 12 requests per minute per project. Amplitude rejects anything above this threshold with a 429 status code.

Request

Send a GET request with required and optional parameters to https://analytics.amplitude.com/api/2/event-streaming/delivery-metrics-summary.

Here is a basic request with only the required parameters.

1curl --location --request GET 'https://analytics.amplitude.com/api/2/event-streaming/delivery-metrics-summary?sync_id=SYNC_ID&time_period=TIME_PERIOD' \
2-u '{api_key}:{secret_key}'

1GET /api/2/event-streaming/delivery-metrics-summary?sync_id=SYNC_ID&time_period=TIME_PERIOD HTTP/1.1
2Host: analytics.amplitude.com
3Authorization: Basic {api-key}:{secret-key} #credentials must be base64-encoded

Example: Get the last four hours

Gets the last four hours of data for the decoded sync ID 30001625.

1curl --location --request GET 'https://analytics.amplitude.com/api/2/event-streaming/delivery-metrics-summary?sync_id=30001625&time_period=FOUR_HOURS' \
2--header 'Authorization: Basic MTIzNDU2NzgwMDoxMjM0NTY3MDA='

1GET /api/2/event-streaming/delivery-metrics-summary?sync_id=30001625&time_period=FOUR_HOURS HTTP/1.1
2Host: analytics.amplitude.com
3Authorization: Basic MTIzNDU2NzgwMDoxMjM0NTY3MDA=

Example: Get the last hour

Gets the last hour of data for the decoded sync ID 30001625.

1curl --location --request GET 'https://analytics.amplitude.com/api/2/event-streaming/delivery-metrics-summary?sync_id=30001625&time_period=ONE_HOUR' \
2--header 'Authorization: Basic MTIzNDU2NzgwMDoxMjM0NTY3MDA='

1GET /api/2/event-streaming/delivery-metrics-summary?sync_id=30001625&time_period=ONE_HOUR HTTP/1.1
2Host: analytics.amplitude.com
3Authorization: Basic MTIzNDU2NzgwMDoxMjM0NTY3MDA=

Example: Get data for a custom period

Gets the data between October 1, 2022 at 7:00 AM UTC +1 and October 31, 2022 at 7:00 AM UTC +1 for the decoded sync ID 30001625.

1curl --location --request GET 'https://analytics.amplitude.com/api/2/event-streaming/delivery-metrics-summary?sync_id=30001625&time_period=CUSTOM&start=2022-10-01T07:00:00+01:00&end=end=2022-10-31T07:00:00+01:00' \
2--header 'Authorization: Basic MTIzNDU2NzgwMDoxMjM0NTY3MDA='

1GET /api/2/event-streaming/delivery-metrics-summary?sync_id=30001625&time_period=CUSTOM&start=2022-10-01T07:00:00+01:00&end=2022-10-31T07:00:00+01:00 HTTP/1.1
2Host: analytics.amplitude.com
3Authorization: Basic MTIzNDU2NzgwMDoxMjM0NTY3MDA=

Query parameters

Name
Description
sync_id Required. The ID for a specific streaming destination. You can find this ID under the title of the sync on the destination's setting page.
time_period Required. Retrieves the data for a specified period. Can be one of the following values:
TEN_MINUTES
ONE_HOUR
FOUR_HOURS
ONE_DAY
ONE_WEEK
TWO_WEEKS
CUSTOM
start Optional, but required if time_period is CUSTOM. The inclusive starting time of the custom interval in the format YYYY-MM-DDThh:mmTZD (ISO-8601). For example, 2022-10-01T07:00:00+01:00
end Optional, required if time_period is CUSTOM. The exclusive end time of the custom interval in the format YYYY-MM-DDThh:mmTZD (ISO-8601). For example, 2022-10-31T07:00:00+01:00

Response

The response is a JSON blob with the retrieved delivery metrics for the specific sync.

Attribute Description
timePeriod string. The time_period sent in the request.
eventsDelivered int. The total number of delivered events.
eventsNotDelivered int. The total number of events that weren't delivered.
deliveryRate double. The delivery success rate.
latencyInSeconds double. The p95 latency in seconds.
timePeriodStart string. The UTC (ISO-8601) timestamp for the request start time.
timePeriodEnd string. The UTC (ISO-8601) timestamp for the request end time.
successOnFirstAttempt int. Events delivered successfully in the first attempt.
successAfterRetry int. Events delivered successfully after one or more retries.
eventsExpired int. Events that weren't sent after all retry attempts.
eventsDiscarded int. Events that weren't sent due to data incomplete/invalid.
1{
2 "timePeriod": "CUSTOM",
3 "eventsDelivered": 19,
4 "eventsNotDelivered": 0,
5 "deliveryRate": 1.0,
6 "latencyInSeconds": 5.098051910578275,
7 "timePeriodStart": "2022-10-01 06:00:00.000000",
8 "timePeriodEnd": "2022-10-31 06:00:00.000000",
9 "successOnFirstAttempt": 19,
10 "successAfterRetry": 0,
11 "eventsExpired": 0,
12 "eventsDiscarded": 0
13}

Status codes

Code Message
200 Success
400 Bad request
401 Unauthorized
403 Forbidden: attempt to access sync outside of organization and app.
429 Rate limit exceeded
500 Internal server error
Was this page helpful?

Thanks for your feedback!

May 21st, 2024

Need help? Contact Support

Visit Amplitude.com

Have a look at the Amplitude Blog

Learn more at Amplitude Academy

© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.