# List all metrics

Returns a list of metrics for a specified source.

[endpoint]
base_url = "https://telemetry.betterstack.com"
path = "/api/v2/sources/{source_id}/metrics"
method = "GET"

[[path_param]]
name = "source_id"
description = "Source for which to retrieve metrics"
required = true
type = "integer"

[[path_param]]
name = "page"
description = "Page number"
required = false
type = "integer"

[[path_param]]
name = "per_page"
description = "The number of sources per page (max 50)"
required = false
type = "integer"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = ''''''
body = '''
{
"data": [
{
"id": "g-123",
"type": "metric",
"attributes": {
"name": "level",
"sql_expression": "JSONExtract(raw, 'level', 'Nullable(String)')",
"aggregations": [],
"type": "string_low_cardinality"
}
},
{
"id": "m-124",
"type": "metric",
"attributes": {
"name": "tid",
"sql_expression": "JSONExtract(raw, 'thread_id', 'Nullable(Int64)')",
"aggregations": ["anyLast", "count"],
"type": "int64_delta"
}
}],
"pagination": {
"first": "https://telemetry.betterstack.com/api/v2/sources/95/metrics?page=1",
"last": "https://telemetry.betterstack.com/api/v2/sources/95/metrics?page=2",
"prev": null,
"next": "https://telemetry.betterstack.com/api/v2/sources/95/metrics?page=2"
}
}
'''
[/responses]

#### Example cURL 

```shell
[label Example]
curl --request GET \
  --url https://telemetry.betterstack.com/api/v2/sources/123/metrics \
  --header "Authorization: Bearer $TOKEN"
```
