Skip to content
PayloadPuffin.
Join the waitlist

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

  • metric string Required

    attempt 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"

  • destinationId string Optional

    Restrict to one destination. Without it, the percentiles cover every destination of the app.

Returns

200

The query result.

  • data object Required

    Latency percentiles of the last 24 hours.

    • metric string Required

      attempt 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"

    • windowHours number Required

      The window the percentiles cover, in hours.

    • p50 number | null Required

      The median in milliseconds, estimated from a histogram. Null when nothing was measured in the window.

    • p95 number | null Required

      The 95th percentile in milliseconds, estimated from a histogram. Null when nothing was measured in the window.

    • p99 number | null Required

      The 99th percentile in milliseconds, estimated from a histogram. Null when nothing was measured in the window.

    • samples number Required

      The number of measurements the percentiles are estimated from.

Example

Request
curl -X GET "https://api.payloadpuffin.com/v1/analytics/latency?metric=attempt" \
  -H "Authorization: Bearer $PAYLOADPUFFIN_API_KEY"
Response 200
{
  "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.

  • 4XX application/problem+json

    The request was rejected.