Event Streaming Metrics Summary API
Considerations
- The latest 4 hours of data is accurate to the minute. Beyond that, the data is aggregated for every hour. Note this when requesting metric data older than 4 hours.
- Amplitude retains event streaming metrics for the last 90 days. Sending
startorendtime beyond this threshold returns a500status.
Limits
The API has a limit of 4 concurrent requests per project, and 12 requests per minute per project. Amplitude rejects requests 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.
The following example shows a basic request with only the required parameters.
bash
curl --location --request GET 'https://analytics.amplitude.com/api/2/event-streaming/delivery-metrics-summary?sync_id=SYNC_ID&time_period=TIME_PERIOD' \
-u '{api_key}:{secret_key}'
Query parameters
| Parameter | Required | Description |
|---|---|---|
sync_id | Yes | The ID for a specific streaming destination. Find this ID under the title of the sync on the destination's setting page. |
time_period | Yes | Retrieves the data for a specified period. One of: TEN_MINUTES, ONE_HOUR, FOUR_HOURS, ONE_DAY, ONE_WEEK, TWO_WEEKS, or CUSTOM. |
start | 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 | 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 object with the delivery metrics for the specified 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. |
json
{
"timePeriod": "CUSTOM",
"eventsDelivered": 19,
"eventsNotDelivered": 0,
"deliveryRate": 1.0,
"latencyInSeconds": 5.098051910578275,
"timePeriodStart": "2022-10-01 06:00:00.000000",
"timePeriodEnd": "2022-10-31 06:00:00.000000",
"successOnFirstAttempt": 19,
"successAfterRetry": 0,
"eventsExpired": 0,
"eventsDiscarded": 0
}
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 helpful?