---
title: "Reads the traffic of a lambda"
method: GET
path: "/lambdas/{privateKey}/traffic"
tags: ["Monitoring"]
---

# Reads the traffic of a lambda

`GET /lambdas/{privateKey}/traffic`

## Request

- Base URL: `https://genhttp.dev/api/v1`
- URL: `https://genhttp.dev/api/v1/lambdas/{privateKey}/traffic`
- Auth: none declared

The last hour by the minute, the last day by the quarter hour, how requests were answered, what was asked for and
at which of its addresses. Counted in memory since the server last started, which `since` says.

## Path parameters

- `privateKey` string, required

## Response `200`

Its traffic since the server came up

- LambdaTraffic: What one lambda has been doing since the server came up. Counted in memory, so a restart of the server starts every figure again from nothing (`since`).
  - `Totals` LambdaActivity: What one lambda has been doing since the server came up, in totals.
    - `PublicKey` string: The lambda, by its public key
    - `Requests` integer: Requests it answered
    - `Failed` integer: Of those, answered with a server error
    - `Upgrades` integer: Connections upgraded to a websocket
    - `AverageMillis` number, double: The mean time to answer, in milliseconds
    - `SlowestMillis` number, double: The longest time to answer, in milliseconds
    - `BytesOut` integer: What the responses carried, counting only those that said how much - a floor rather than a total
    - `FirstSeen` string, date-time, nullable: When the first request arrived
    - `LastSeen` string, date-time, nullable: When the last request arrived
  - `Minutes` TrafficPoint[]: The last hour, a minute at a time, oldest first
    - `At` string, date-time: When the interval started
    - `Requests` integer: Requests answered in it
    - `Failed` integer: Of those, answered with a server error (5xx)
    - `Rejected` integer: Of those, answered with a client error (4xx), not found included
    - `Upgrades` integer: Connections upgraded to a websocket
    - `AverageMillis` number, double: The mean time to answer, over its requests, in milliseconds
    - `Bytes` integer: What the responses carried, where they said how much
  - `Quarters` TrafficPoint[]: The last day, a quarter of an hour at a time, oldest first
    - `At` string, date-time: When the interval started
    - `Requests` integer: Requests answered in it
    - `Failed` integer: Of those, answered with a server error (5xx)
    - `Rejected` integer: Of those, answered with a client error (4xx), not found included
    - `Upgrades` integer: Connections upgraded to a websocket
    - `AverageMillis` number, double: The mean time to answer, over its requests, in milliseconds
    - `Bytes` integer: What the responses carried, where they said how much
  - `Statuses` StatusClasses: Requests by the class of status they were answered with.
    - `Success` integer: 2xx
    - `Redirect` integer: 3xx
    - `ClientError` integer: 4xx, not found included
    - `ServerError` integer: 5xx
  - `Paths` PathTraffic[]: What was asked for, the busiest paths first
    - `Path` string: The path, relative to the lambda - the same wherever it is reached
    - `Requests` integer: How often it was asked for
    - `Failed` integer: Of those, answered with a server error
    - `AverageMillis` number, double: The mean time to answer it, in milliseconds
  - `Entrances` EntranceTraffic[]: Where it was reached - its subdomain of the hosting domain, or its own domain - the busiest first
    - `Domain` string, nullable: The host it was reached at - its subdomain of the hosting domain, or its own domain
    - `Requests` integer: Requests and websocket upgrades alike - every time somebody came in this way
  - `Since` string, date-time: When the counting started, which is when the server came up

## Other responses

- `204`: A response containing no body
- `404`: No lambda has this editor key. A key that never existed and the key of a deleted lambda are answered alike.

---

[API](https://skmtc.dev/genhttp/apis/genhttp-lambda-api.md) · [All operations](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/llms.txt) · [OpenAPI document](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/revisions/8b36699e03df?raw)
