# pub.chive.admin.getEndpointMetrics

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getEndpointMetrics)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getEndpointMetrics/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getEndpointMetrics/examples)

## Definitions

### `pub.chive.admin.getEndpointMetrics`

**Type**: `query`

Get per-endpoint HTTP request metrics from Prometheus

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `metrics` | `array` | Yes | Endpoint metric entries |

#### Errors

- **AuthenticationRequired**
- **AdminRequired**

### `pub.chive.admin.getEndpointMetrics#endpointMetric`

**Type**: `object`

HTTP endpoint performance metric

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `p50` | `integer` | No | 50th percentile latency in microseconds |
| `p95` | `integer` | No | 95th percentile latency in microseconds |
| `p99` | `integer` | No | 99th percentile latency in microseconds |
| `path` | `string` | Yes | Endpoint path |
| `method` | `string` | Yes | HTTP method (GET, POST, etc.) |
| `errorRate` | `integer` | No | Error rate in basis points (100 = 1%) |
| `errorCount` | `integer` | Yes | Total error responses |
| `requestCount` | `integer` | Yes | Total requests |

## Raw Schema

```json
{
  "id": "pub.chive.admin.getEndpointMetrics",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AdminRequired"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "metrics"
          ],
          "properties": {
            "metrics": {
              "type": "array",
              "items": {
                "ref": "#endpointMetric",
                "type": "ref"
              },
              "description": "Endpoint metric entries"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {}
      },
      "description": "Get per-endpoint HTTP request metrics from Prometheus"
    },
    "endpointMetric": {
      "type": "object",
      "required": [
        "method",
        "path",
        "requestCount",
        "errorCount"
      ],
      "properties": {
        "p50": {
          "type": "integer",
          "description": "50th percentile latency in microseconds"
        },
        "p95": {
          "type": "integer",
          "description": "95th percentile latency in microseconds"
        },
        "p99": {
          "type": "integer",
          "description": "99th percentile latency in microseconds"
        },
        "path": {
          "type": "string",
          "description": "Endpoint path"
        },
        "method": {
          "type": "string",
          "description": "HTTP method (GET, POST, etc.)"
        },
        "errorRate": {
          "type": "integer",
          "description": "Error rate in basis points (100 = 1%)"
        },
        "errorCount": {
          "type": "integer",
          "description": "Total error responses"
        },
        "requestCount": {
          "type": "integer",
          "description": "Total requests"
        }
      },
      "description": "HTTP endpoint performance metric"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
