# pub.chive.admin.getPrometheusMetrics

> 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.getPrometheusMetrics)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getPrometheusMetrics/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getPrometheusMetrics/examples)

## Definitions

### `pub.chive.admin.getPrometheusMetrics`

**Type**: `query`

Get Prometheus metrics as JSON

#### Parameters

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

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `metrics` | `array` | Yes | Prometheus metric entries |
| `timestamp` | `string` (datetime) | Yes | Timestamp of the metrics snapshot |

#### Errors

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

### `pub.chive.admin.getPrometheusMetrics#labelSet`

**Type**: `object`

Key-value pairs for metric labels

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

### `pub.chive.admin.getPrometheusMetrics#metricValue`

**Type**: `object`

A single metric value with its label set

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `value` | `string` | Yes | Metric value (numeric string) |
| `labels` | `ref` → `#labelSet` | No | Label key-value pairs |
| `exemplar` | `string` | No | Optional exemplar value (numeric string) |

### `pub.chive.admin.getPrometheusMetrics#prometheusMetric`

**Type**: `object`

A single Prometheus metric with its values

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `help` | `string` | Yes | Metric help text |
| `name` | `string` | Yes | Metric name |
| `type` | `string` | Yes | Metric type |
| `values` | `array` | Yes | Metric values with labels |

## Raw Schema

```json
{
  "id": "pub.chive.admin.getPrometheusMetrics",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AdminRequired"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "metrics",
            "timestamp"
          ],
          "properties": {
            "metrics": {
              "type": "array",
              "items": {
                "ref": "#prometheusMetric",
                "type": "ref"
              },
              "description": "Prometheus metric entries"
            },
            "timestamp": {
              "type": "string",
              "format": "datetime",
              "description": "Timestamp of the metrics snapshot"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {}
      },
      "description": "Get Prometheus metrics as JSON"
    },
    "labelSet": {
      "type": "object",
      "properties": {},
      "description": "Key-value pairs for metric labels"
    },
    "metricValue": {
      "type": "object",
      "required": [
        "value"
      ],
      "properties": {
        "value": {
          "type": "string",
          "description": "Metric value (numeric string)"
        },
        "labels": {
          "ref": "#labelSet",
          "type": "ref",
          "description": "Label key-value pairs"
        },
        "exemplar": {
          "type": "string",
          "description": "Optional exemplar value (numeric string)"
        }
      },
      "description": "A single metric value with its label set"
    },
    "prometheusMetric": {
      "type": "object",
      "required": [
        "name",
        "help",
        "type",
        "values"
      ],
      "properties": {
        "help": {
          "type": "string",
          "description": "Metric help text"
        },
        "name": {
          "type": "string",
          "description": "Metric name"
        },
        "type": {
          "type": "string",
          "description": "Metric type",
          "knownValues": [
            "counter",
            "gauge",
            "histogram",
            "summary"
          ]
        },
        "values": {
          "type": "array",
          "items": {
            "ref": "#metricValue",
            "type": "ref"
          },
          "description": "Metric values with labels"
        }
      },
      "description": "A single Prometheus metric with its values"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
