# Flow Run Metrics

Query for time series metrics that will provide you details around the total number of flow run invocations, failures, errors and similar metrics.

In order to query flow run metrics you must have the **Flow ID**  and perform a HTTP request to the following endpoint with a valid access key.

| Filter Types | Filter ID                     |
| ------------ | ----------------------------- |
| flow         | The **Flow ID** from the flow |

## Fetch flow metrics

> Fetch flow metrics for a flow

```json
{"openapi":"3.0.3","info":{"title":"Reporting","version":"v1"},"tags":[{"name":"metrics","description":"Provide metrics to the customers"}],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')","scheme":"AccessKey","type":"http"}},"schemas":{"FlowRunCreate":{"type":"object","title":"CreateMessageMetrics","additionalProperties":false,"required":["periodStart","periodEnd","periodGroup"],"properties":{"periodStart":{"$ref":"#/components/schemas/PeriodTime"},"periodEnd":{"$ref":"#/components/schemas/PeriodTime"},"periodGroup":{"type":"string","enum":["minute","hour","day","month"]},"groupBy":{"type":"array","nullable":true,"items":{"type":"string","enum":["status"]}}}},"PeriodTime":{"type":"string","format":"date-time"},"FlowRunResult":{"type":"object","title":"MetricsList","description":"A list of metrics","required":["dataColumns"],"properties":{"periodGroup":{"type":"string","enum":["minute","hour","day","month"]},"dataColumns":{"type":"array","items":{"type":"string","enum":["status"]}},"results":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["periodTime"],"properties":{"periodTime":{"type":"string","format":"date-time"},"count":{"type":"integer","format":"int64"},"data":{"type":"array","nullable":true,"items":{"type":"string"}}}}}}},"ValidationError":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}},"required":["code","message"]}},"responses":{"validationError":{"description":"The request did not pass validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/workspaces/{workspaceId}/reporting/flowruns/{filterType}/{filterId}/metrics":{"post":{"summary":"Fetch flow metrics","operationId":"getFlowRunMetricsByFilter","description":"Fetch flow metrics for a flow","tags":["metrics"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowRunCreate"}}}},"responses":{"200":{"description":"List of results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowRunResult"}}}},"422":{"$ref":"#/components/responses/validationError"}}}}}}
```
