Search spans
POST {{baseUrl}}/api/v2/spans/events/search
List endpoint returns spans that match a span search query. Results are paginated.
Use this endpoint to build complex spans filtering and search.
This endpoint is rate limited to 300
requests per hour.
Request Body
{"data"=>{"attributes"=>{"filter"=>{"from"=>"now-15m", "query"=>"service:web* AND @http.status_code:[200 TO 299]", "to"=>"now"}, "options"=>{"timeOffset"=>-7243542, "timezone"=>"GMT"}, "page"=>{"cursor"=>"eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit"=>25}, "sort"=>"timestamp"}, "type"=>"search_request"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"data":[{"attributes":{"attributes":{"customAttribute":123,"duration":2345},"custom":{"sedcc5":{}},"end_timestamp":"2023-01-02T09:42:36.420Z","env":"prod","host":"i-0123","ingestion_reason":"rule","parent_id":"0","resource_hash":"a12345678b91c23d","resource_name":"agent","retained_by":"retention_filter","service":"agent","single_span":true,"span_id":"1234567890987654321","start_timestamp":"2023-01-02T09:42:36.320Z","tags":["team:A"],"trace_id":"1234567890987654321","type":"web"},"id":"AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA","type":"spans"},{"attributes":{"attributes":{"customAttribute":123,"duration":2345},"custom":{"irure_dca":{}},"end_timestamp":"2023-01-02T09:42:36.420Z","env":"prod","host":"i-0123","ingestion_reason":"rule","parent_id":"0","resource_hash":"a12345678b91c23d","resource_name":"agent","retained_by":"retention_filter","service":"agent","single_span":true,"span_id":"1234567890987654321","start_timestamp":"2023-01-02T09:42:36.320Z","tags":["team:A"],"trace_id":"1234567890987654321","type":"web"},"id":"AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA","type":"spans"}],"links":{"next":"https://app.datadoghq.com/api/v2/spans/event?filter[query]=foo\u0026page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="},"meta":{"elapsed":132,"page":{"after":"eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="},"request_id":"MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR","status":"done","warnings":[{"code":"unknown_index","detail":"indexes: foo, bar","title":"One or several indexes are missing or invalid, results hold data from the other indexes"},{"code":"unknown_index","detail":"indexes: foo, bar","title":"One or several indexes are missing or invalid, results hold data from the other indexes"}]}}