# Query Metrics

get ` /ui/connectors/channels-api/latest/metrics/query/`

Execute arbitrary PromQL range query. Returns Prometheus format.

## Query parameters

- **query** (string, Required): PromQL query
- **start** (string, Required): Start time (ISO8601 or Unix timestamp)
- **end** (string, Required): End time (ISO8601 or Unix timestamp)
- **step** (string, Optional, Defaults to 60s): Query resolution step (e.g. 60s, 5m, 1h)

## Response

### 200 Successful Response

- **status** (string, Required): 'success' or 'error'
- **data** (object, Optional):  
   - **PrometheusMatrixData** (object): Data section of a matrix response.
     - **resultType** (string, Optional, Defaults to matrix): 
     - **result** (list of objects [PrometheusMatrixResult](https://docs.mediakind.com/api-reference/channels-api/schemas/prometheusmatrixresult), Required):  
         - **metric** (object [PrometheusMetricLabels](https://docs.mediakind.com/api-reference/channels-api/schemas/prometheusmetriclabels), Required): Metric labels from Prometheus. Allows arbitrary labels.
         - **serverID** (object, Optional): 
           - **string** (Variant 1: `string`)
           - **null** (Variant 2: `null`)
         - **name** (object, Optional): 
           - **string** (Variant 1: `string`)
           - **null** (Variant 2: `null`)
         - **job** (object, Optional): 
           - **string** (Variant 1: `string`)
           - **null** (Variant 2: `null`)
         - **values** (list of list of items, Required): Array of \[unix_timestamp, value_string\] pairs
         - **error** (object, Optional): Error message if status is 'error'  
           - **string** (Variant 1: `string`)
           - **null** (Variant 2: `null`)
         - **errorType** (object, Optional):  
           - **string** (Variant 1: `string`)
           - **null** (Variant 2: `null`)

## Errors

### 422 Validation Error

- **detail** (list of objects [ValidationError](https://docs.mediakind.com/api-reference/channels-api/schemas/validationerror), Optional): 
   - **loc** (list of objects, Required): 
   - **msg** (string, Required):  
   - **type** (string, Required):  
   - **input** (any, Optional):  
   - **ctx** (object, Optional):
