# at.happyproto.fleet.getIngestHealth

> Report lag, clock skew and schema-version spread. Lag and skew are separate facts and must not be averaged together. Admin only.

- Kind: query
- Authority: fleet.happyproto.at
- Lexicon: 1
- Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getIngestHealth)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getIngestHealth/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getIngestHealth/analytics)

## Query (`at.happyproto.fleet.getIngestHealth`)

Type: query · GET

### Output (application/json)

- `have` (integer): History available, when accruing.
- `lag` (ref)
  - Reference: `#lag`
- `need` (integer): History required, when accruing.
- `schemaVersions` (array)
  - `items` (ref)
    - Reference: `#schemaVersion`
- `skewed` (array)
  - `items` (ref)
    - Reference: `#skew`
- `status` (string, required): Why a figure is absent. Branch on this, never on field presence.
  - Constraints: knownValues: ok | accruing | withheld
- `unit` (string)
  - Constraints: knownValues: days | snapshots
- `windowDays` (integer)

### Errors

- `AuthRequired`: This endpoint requires an authenticated caller.
- `Forbidden`: The caller is not a HappyProto admin.
- `Upstream`: The telemetry store could not be queried.

## #lag (`at.happyproto.fleet.getIngestHealth#lag`)

Type: object

### Properties

- `max` (integer, required)
- `p50` (integer, required)
- `p90` (integer, required)

## #schemaVersion (`at.happyproto.fleet.getIngestHealth#schemaVersion`)

Type: object

### Properties

- `instances` (integer, required)
- `version` (integer, required)

## #skew (`at.happyproto.fleet.getIngestHealth#skew`)

Type: object

### Properties

- `aheadSeconds` (integer, required): Seconds the snapshot was stamped ahead of receipt. A wrong clock makes every delta from this instance suspect.
- `instanceId` (string, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "lag": {
      "properties": {
        "max": {
          "type": "integer"
        },
        "p50": {
          "type": "integer"
        },
        "p90": {
          "type": "integer"
        }
      },
      "required": [
        "p50",
        "p90",
        "max"
      ],
      "type": "object"
    },
    "main": {
      "description": "Report lag, clock skew and schema-version spread. Lag and skew are separate facts and must not be averaged together. Admin only.",
      "errors": [
        {
          "description": "This endpoint requires an authenticated caller.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller is not a HappyProto admin.",
          "name": "Forbidden"
        },
        {
          "description": "The telemetry store could not be queried.",
          "name": "Upstream"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "have": {
              "description": "History available, when accruing.",
              "type": "integer"
            },
            "lag": {
              "ref": "#lag",
              "type": "ref"
            },
            "need": {
              "description": "History required, when accruing.",
              "type": "integer"
            },
            "schemaVersions": {
              "items": {
                "ref": "#schemaVersion",
                "type": "ref"
              },
              "type": "array"
            },
            "skewed": {
              "items": {
                "ref": "#skew",
                "type": "ref"
              },
              "type": "array"
            },
            "status": {
              "description": "Why a figure is absent. Branch on this, never on field presence.",
              "knownValues": [
                "ok",
                "accruing",
                "withheld"
              ],
              "type": "string"
            },
            "unit": {
              "knownValues": [
                "days",
                "snapshots"
              ],
              "type": "string"
            },
            "windowDays": {
              "type": "integer"
            }
          },
          "required": [
            "status"
          ],
          "type": "object"
        }
      },
      "type": "query"
    },
    "schemaVersion": {
      "properties": {
        "instances": {
          "type": "integer"
        },
        "version": {
          "type": "integer"
        }
      },
      "required": [
        "version",
        "instances"
      ],
      "type": "object"
    },
    "skew": {
      "properties": {
        "aheadSeconds": {
          "description": "Seconds the snapshot was stamped ahead of receipt. A wrong clock makes every delta from this instance suspect.",
          "type": "integer"
        },
        "instanceId": {
          "type": "string"
        }
      },
      "required": [
        "instanceId",
        "aheadSeconds"
      ],
      "type": "object"
    }
  },
  "id": "at.happyproto.fleet.getIngestHealth",
  "lexicon": 1
}
```
