# at.happyproto.fleet.getTenantIngestMetrics

> How any tenant handled incoming records in a window, by collection and action. The same shape as server.getIngestMetrics. 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.getTenantIngestMetrics)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getTenantIngestMetrics/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.fleet.getTenantIngestMetrics/analytics)

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

Type: query · GET

### Parameters (query string)

- `tenant` (string, required): The instance id.
- `window` (string): How far back to read. 1h and 24h come from the instance's memory; 7d and 30d from what it stored, as far back as it keeps.
  - Constraints: default: "1h", knownValues: 1h | 24h | 7d | 30d

### Output (application/json)

- `collections` (array, required)
  - `items` (ref)
    - Reference: `at.happyproto.server.getIngestMetrics#collection`
- `enabled` (boolean, required): Whether the instance is recording metrics at all.
- `retentionDays` (integer): On 7d and 30d: how many days the instance keeps, so a longer window covers only that.
- `window` (string, required)
  - Constraints: knownValues: 1h | 24h | 7d | 30d

### Errors

- `InvalidRequest`: The tenant id is not a UUID, or the window is not one this method takes.
- `NotFound`: No such tenant.
- `MetricsUnavailable`: The instance is not running, or its host cannot be reached.
- `MetricsBusy`: Too many metrics reads are running for this instance or its host. Try again shortly.
- `MetricsTimeout`: The instance's HappyView did not answer in time. Try again shortly.
- `NotSupported`: The instance runs a HappyView too old to report its metrics. Upgrading it fixes this.
- `AuthRequired`: This endpoint requires an authenticated caller.
- `Forbidden`: The caller is not HappyProto staff, or the provisioner does not treat them as staff.
- `InvalidSlug`: Passed through from the provisioner.
- `SlugTaken`: Passed through from the provisioner.
- `NotEntitled`: Passed through from the provisioner.
- `InstanceLimit`: Passed through from the provisioner.
- `NoCapacity`: Passed through from the provisioner.
- `OperationInProgress`: Passed through from the provisioner.
- `Upstream`: The provisioner is unreachable, not configured, or answered with an error it does not explain to callers.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "How any tenant handled incoming records in a window, by collection and action. The same shape as server.getIngestMetrics. Admin only.",
      "errors": [
        {
          "description": "The tenant id is not a UUID, or the window is not one this method takes.",
          "name": "InvalidRequest"
        },
        {
          "description": "No such tenant.",
          "name": "NotFound"
        },
        {
          "description": "The instance is not running, or its host cannot be reached.",
          "name": "MetricsUnavailable"
        },
        {
          "description": "Too many metrics reads are running for this instance or its host. Try again shortly.",
          "name": "MetricsBusy"
        },
        {
          "description": "The instance's HappyView did not answer in time. Try again shortly.",
          "name": "MetricsTimeout"
        },
        {
          "description": "The instance runs a HappyView too old to report its metrics. Upgrading it fixes this.",
          "name": "NotSupported"
        },
        {
          "description": "This endpoint requires an authenticated caller.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller is not HappyProto staff, or the provisioner does not treat them as staff.",
          "name": "Forbidden"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "InvalidSlug"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "SlugTaken"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "NotEntitled"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "InstanceLimit"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "NoCapacity"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "OperationInProgress"
        },
        {
          "description": "The provisioner is unreachable, not configured, or answered with an error it does not explain to callers.",
          "name": "Upstream"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "collections": {
              "items": {
                "ref": "at.happyproto.server.getIngestMetrics#collection",
                "type": "ref"
              },
              "type": "array"
            },
            "enabled": {
              "description": "Whether the instance is recording metrics at all.",
              "type": "boolean"
            },
            "retentionDays": {
              "description": "On 7d and 30d: how many days the instance keeps, so a longer window covers only that.",
              "type": "integer"
            },
            "window": {
              "knownValues": [
                "1h",
                "24h",
                "7d",
                "30d"
              ],
              "type": "string"
            }
          },
          "required": [
            "window",
            "enabled",
            "collections"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "tenant": {
            "description": "The instance id.",
            "type": "string"
          },
          "window": {
            "default": "1h",
            "description": "How far back to read. 1h and 24h come from the instance's memory; 7d and 30d from what it stored, as far back as it keeps.",
            "knownValues": [
              "1h",
              "24h",
              "7d",
              "30d"
            ],
            "type": "string"
          }
        },
        "required": [
          "tenant"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "at.happyproto.fleet.getTenantIngestMetrics",
  "lexicon": 1
}
```
