Skip to content

Query Traces within the Same Organization



POST /api/v1/df/same_org/trace/query

Overview

Query tracing data from the current workspace or a specified workspace within the same organization by traceId.

Body Request Parameters

Parameter Name Type Required Description
traceId string Y Trace ID, max length 512
Allow empty: False
workspaceUUIDs array Optional, specify a list of workspace UUIDs within the same organization, max length of a single UUID is 128; if not provided or an empty array, query from the current workspace
Allow empty: True
startTime integer Optional, query start time, 13-digit millisecond timestamp
Allow empty: True
endTime integer Optional, query end time, 13-digit millisecond timestamp; if not provided, the end time is not automatically appended
Allow empty: True
source string Optional, tracing source; if not provided, query all sources; only supports specific source name or *, max length 128
Allow empty: True
whereClause string Optional, additional DQL where clause fragment, max length 4096, does not include outer curly braces; the server will perform parser validation
Allow empty: True
limit integer Optional, limit on the number of returned results; if not provided, the default DQL page size is used; if explicitly provided, the default max is 1000, subject to site configuration
Allow empty: True
searchAfter array Optional, legacy pagination compatibility field; not used in Doris queries, do not construct based on __docid
Allow empty: True
cursorTime integer Optional, scroll pagination cursor; for the first query, use a 13-digit millisecond timestamp; for subsequent queries, pass the 16-digit microsecond next_cursor_time from the response as-is
Allow empty: True
cursorToken string Optional, pass the next_cursor_token from the response as-is; can be omitted or set to an empty string when the response is empty, max length 512
Allow empty: True

Additional Parameter Notes

This interface is only used for trace queries and does not support the generic DQL q.

Parameter Name Type Required Description
traceId string Y Trace ID
workspaceUUIDs array List of workspace UUIDs within the same organization; max length of a single UUID is 128; if not provided or an empty array, query from the current workspace
startTime integer Query start time; if not provided, defaults to the start time of the last 1 hour
endTime integer Query end time; if not provided, the internal time_range only includes the start time
source string Tracing source; if not provided, query all sources; only supports specific source name or *, max length 128
whereClause string Additional DQL where clause fragment, max length 4096, does not include outer curly braces; the server will perform parser validation
limit integer Limit on the number of returned results; if not provided, the default DQL page size is used; if explicitly provided, the default max is 1000, subject to site configuration
searchAfter array Legacy pagination compatibility field; not used in Doris queries, do not construct based on __docid
cursorTime integer Scroll pagination cursor; for the first query, use a 13-digit millisecond timestamp; for subsequent queries, pass the 16-digit microsecond next_cursor_time from the response as-is
cursorToken string Pass the next_cursor_token from the response as-is; can be omitted or set to an empty string when the response is empty, max length 512

OpenAPI parameters follow lower camelCase; selectClause and offset are not supported. Pagination should use cursorTime / cursorToken, and end when next_cursor_time is less than 0.

Response

{
    "code": 200,
    "content": {
        "data": [
            {
                "series": [
                    {
                        "columns": [
                            "trace_id",
                            "service"
                        ],
                        "values": [
                            [
                                "TRACE-XXXX",
                                "api"
                            ]
                        ]
                    }
                ],
                "next_cursor_time": 1772519730000123,
                "next_cursor_token": ""
            }
        ]
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-XXXX"
}

Feedback

Is this page helpful? ×