Our Python SDK got smarter. We developed a Typscript SDK too. We are updating our SDK code blocks. Python SDKhere.Typscript SDKhere.
Description
Patronus AI APIOpen telemetry

Query Spans

POST
/v1/otel/spans/query
/v1/otel/spans/query

The Authorization access token

Authorization

X-API-KEY<token>

In: header

Request Body

application/jsonRequired

select
Required
Select

filtersFilters

group_byGroup By

order_byOrder By

curl -X POST "https://api.patronus.ai/v1/otel/spans/query" \
  -H "X-API-KEY: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "select": [
      {
        "type": "field",
        "field": "string",
        "label": "string"
      }
    ],
    "filters": [
      {
        "field": "string",
        "op": "eq",
        "value": {},
        "or_": [
          {
            "field": "string",
            "op": "eq",
            "value": {},
            "or_": [
              {}
            ],
            "and_": [
              {
                "field": "string",
                "op": "eq",
                "value": {},
                "or_": [
                  {}
                ],
                "and_": [
                  {}
                ]
              }
            ]
          }
        ],
        "and_": [
          {
            "field": "string",
            "op": "eq",
            "value": {},
            "or_": [
              {
                "field": "string",
                "op": "eq",
                "value": {},
                "or_": [
                  {}
                ],
                "and_": [
                  {}
                ]
              }
            ],
            "and_": [
              {}
            ]
          }
        ]
      }
    ],
    "group_by": [
      0
    ],
    "order_by": [
      {
        "col": 0,
        "ascending": true
      }
    ]
  }'

Successful Response

{
  "columns": [
    "string"
  ],
  "rows": [
    [
      null
    ]
  ]
}