Skip to main content

Methods

Parameters

Parameters

start_time
str
required
Start time in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z)
tracing_project_fqn
str
required
Tracing project FQN (e.g., truefoundry:tracing-project:tfy-default)
end_time
typing.Optional[str]
End time in ISO 8601 format (e.g., 2025-03-12T00:10:00.000Z). Defaults to current time if not provided.
trace_ids
typing.Optional[typing.Sequence[str]]
Array of trace IDs to filter by
span_ids
typing.Optional[typing.Sequence[str]]
Array of span IDs to filter by
parent_span_ids
typing.Optional[typing.Sequence[str]]
Array of parent span IDs to filter by
created_by_subject_types
typing.Optional[typing.Sequence[TracesSubjectType]]
🔗 TracesSubjectTypeArray of subject types to filter by
created_by_subject_slugs
typing.Optional[typing.Sequence[str]]
Array of subject slugs to filter by
application_names
typing.Optional[typing.Sequence[str]]
Array of application names to filter by
limit
typing.Optional[int]
The maximum number of spans to return per page. Defaults to 200 if not provided.
sort_direction
typing.Optional[SortDirection]
🔗 SortDirectionSort direction for results based on time. Defaults to descending (latest first)
page_token
typing.Optional[str]
Cursor token for pagination. This is an opaque string that should be passed as-is from the previous response

Returns

SyncPager[TraceSpan]
SyncPager[TraceSpan]
🔗 TraceSpanReturns all the spans matching the query.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.traces.query_spans(
    start_time="value",
    tracing_project_fqn="value",
    end_time="value",
    trace_ids="value",
    span_ids="value",
    parent_span_ids="value",
    created_by_subject_types="value",
    created_by_subject_slugs="value",
    application_names="value",
    limit=10,
    sort_direction="value",
    page_token="value",
)