# projectMetrics

```graphql
query ProjectMetrics($input: ProjectMetricsInput!) {
  projectMetrics(input: $input) {
    series {
      metric
      labels
    }
    stats {
      queryTimeMs
    }
  }
}
```

Query project metrics. Requires project.metrics.read.

## Arguments

| Name                     | Type                 | Required | Description                                         |
| ------------------------ | -------------------- | -------- | --------------------------------------------------- |
| `input`                  | ProjectMetricsInput! | Yes      |                                                     |
| `input.projectReference` | String!              | Yes      |                                                     |
| `input.metric`           | String!              | Yes      |                                                     |
| `input.start`            | String               |          |                                                     |
| `input.end`              | String               |          |                                                     |
| `input.step`             | String               |          |                                                     |
| `input.aggregation`      | MetricAggregation    |          | One of `none`, `sum`, `avg`, `min`, `max`, `count`. |
| `input.labels`           | JSON                 |          |                                                     |

## Variables

```json
{
  "input": {
    "projectReference": "string",
    "metric": "string"
  }
}
```

## Responses

| Status | Description                                    |
| ------ | ---------------------------------------------- |
| 200    | The MetricQueryResult! in data.projectMetrics. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query ProjectMetrics($input: ProjectMetricsInput!) {\n  projectMetrics(input: $input) {\n    series {\n      metric\n      labels\n    }\n    stats {\n      queryTimeMs\n    }\n  }\n}",
  "variables": {
    "input": {
      "projectReference": "string",
      "metric": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "projectMetrics": {
      "series": [
        {
          "metric": "string",
          "labels": {}
        }
      ],
      "stats": {
        "queryTimeMs": 0
      }
    }
  }
}
```
