Get latency percentiles
GET/v1/analytics/latencypreview
Get the p50, p95 and p99 of one latency metric over the last 24 hours, for the whole app or one destination. Percentiles are estimated from a histogram.
Query parameters
metricstring Requiredattempt is one HTTP request to a destination. queue spans event accepted to first attempt started, delivery spans event accepted to first success, and terminal spans event accepted to success or the last failed attempt.
Allowed values: "attempt", "queue", "delivery", "terminal"
destinationIdstring OptionalRestrict to one destination. Without it, the percentiles cover every destination of the app.
Returns
The query result.200
dataobject RequiredLatency percentiles of the last 24 hours.
metricstring Requiredattempt is one HTTP request to a destination. queue spans event accepted to first attempt started, delivery spans event accepted to first success, and terminal spans event accepted to success or the last failed attempt.
Allowed values: "attempt", "queue", "delivery", "terminal"
windowHoursnumber RequiredThe window the percentiles cover, in hours.
p50number | null RequiredThe median in milliseconds, estimated from a histogram. Null when nothing was measured in the window.
p95number | null RequiredThe 95th percentile in milliseconds, estimated from a histogram. Null when nothing was measured in the window.
p99number | null RequiredThe 99th percentile in milliseconds, estimated from a histogram. Null when nothing was measured in the window.
samplesnumber RequiredThe number of measurements the percentiles are estimated from.
Example
curl -X GET "https://api.payloadpuffin.com/v1/analytics/latency?metric=attempt" \
-H "Authorization: Bearer $PAYLOADPUFFIN_API_KEY"{
"data": {
"metric": "attempt",
"windowHours": 0,
"p50": 0,
"p95": 0,
"p99": 0,
"samples": 0
}
}Errors
Errors use application/problem+json. The code member is stable; branch on it rather than on title or detail.
4XXapplication/problem+jsonThe request was rejected.