List all existing metrics for source

Returns a list of metrics for a specified source.

GET https://logs.betterstack.com/api/v2/sources/{source_id}/metrics

URL parameters

source_id
required integer
page
integer
per_page
integer

Headers

Authorization
required string
200

Response body

{
  "data": [
    {
      "id": "g-123",
      "type": "metric",
      "attributes": {
        "name": "level",
        "sql_expression": "JSONExtract(json, 'level', 'Nullable(String)')",
        "aggregations": [

        ],
        "type": "string_low_cardinality"
      }
    },
    {
      "id": "m-124",
      "type": "metric",
      "attributes": {
        "name": "tid",
        "sql_expression": "JSONExtract(json, 'thread_id', 'Nullable(Int64)')",
        "aggregations": [
          "anyLast",
          "count"
        ],
        "type": "int64_delta"
      }
    }
  ],
  "pagination": {
    "first": "https://logs.betterstack.com/api/v2/sources/95/metrics?page=1",
    "last": "https://logs.betterstack.com/api/v2/sources/95/metrics?page=2",
    "prev": null,
    "next": "https://logs.betterstack.com/api/v2/sources/95/metrics?page=2"
  }
}