Skip to main content
POST
/
api
/
svc
/
v1
/
spans
/
query
Get filtered spans data with detailed attributes
curl --request POST \
  --url https://{controlPlaneURL}/api/svc/v1/spans/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "startTime": "<string>",
  "endTime": "<string>",
  "traceIds": [
    "traceid1",
    "traceid2"
  ],
  "spanIds": [
    "spanId1",
    "spanId2"
  ],
  "parentSpanIds": [
    "parentSpanId1",
    "parentSpanId2"
  ],
  "createdBySubjectTypes": [
    "user",
    "virtualaccount"
  ],
  "createdBySubjectSlugs": [
    "user@example.com",
    "service-account"
  ],
  "applicationNames": [
    "tfy-llm-gateway",
    "order-service"
  ],
  "limit": 200,
  "sortDirection": "desc",
  "pageToken": "eyJlbmRUaW1lIjoiMjAyNS0wMy0xMlQwMDoxMDowMC4wMDBaIiwidHJhY2VJZCI6IjEyMzQ1Njc4OTAifQ==",
  "tracingProjectFqn": "<string>"
}'

Authorizations

Authorization
string
header
required

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

Body

application/json
startTime
string
required

Start time in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z)

endTime
string
required

End time in ISO 8601 format (e.g., 2025-03-12T00:10:00.000Z)

tracingProjectFqn
string
required

Tracing project FQN (e.g., truefoundry:tracing-project:tfy-default)

traceIds
string[]

Array of trace IDs to filter by

Example:
["traceid1", "traceid2"]
spanIds
string[]

Array of span IDs to filter by

Example:
["spanId1", "spanId2"]
parentSpanIds
string[]

Array of parent span IDs to filter by

Example:
["parentSpanId1", "parentSpanId2"]
createdBySubjectTypes
enum<string>[]

Array of subject types to filter by

Example:
["user", "virtualaccount"]
createdBySubjectSlugs
string[]

Array of subject slugs to filter by

Example:
["user@example.com", "service-account"]
applicationNames
string[]

Array of application names to filter by

Example:
["tfy-llm-gateway", "order-service"]
limit
integer

The maximum number of spans to return per page. Defaults to 200 if not provided.

Example:

200

sortDirection
enum<string>

Sort direction for results. Defaults to desc.

Available options:
asc,
desc
Example:

"desc"

pageToken
string

Base64 encoded page token for pagination

Example:

"eyJlbmRUaW1lIjoiMjAyNS0wMy0xMlQwMDoxMDowMC4wMDBaIiwidHJhY2VJZCI6IjEyMzQ1Njc4OTAifQ=="

I