Skip to main content
POST
/
v2
/
metrics
Get metrics with filtering and grouping
curl --request POST \
  --url https://api.traceloop.com/v2/metrics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "cursor": 123,
  "environments": [
    "<string>"
  ],
  "filters": [
    {
      "field": "<string>",
      "operator": "<string>",
      "value": "<string>",
      "valueType": "<string>",
      "values": [
        "<string>"
      ]
    }
  ],
  "from_timestamp_sec": 123,
  "limit": 123,
  "logical_operator": "AND",
  "metric_name": "<string>",
  "metric_source": "<string>",
  "sort_by": "<string>",
  "sort_order": "<string>",
  "to_timestamp_sec": 123
}
'
{
  "metrics": {
    "data": [
      {
        "metric_name": "<string>",
        "organization_id": "<string>",
        "points": [
          {
            "bool_value": true,
            "enum_value": "<string>",
            "event_time": 123,
            "labels": {},
            "numeric_value": 123
          }
        ]
      }
    ],
    "next_cursor": "<string>",
    "total_points": 123,
    "total_results": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

project_id
string
required

Project ID

Body

application/json

Metrics query parameters including filters, environments, and pagination

cursor
integer
environments
string[]
filters
object[]
from_timestamp_sec
integer
limit
integer
logical_operator
enum<string>
Available options:
AND,
OR
metric_name
string
metric_source
string
sort_by
string
sort_order
string
to_timestamp_sec
integer

Response

Grouped metrics with data points

metrics
object