Skip to main content

Methods

Fetch logs for various workload components, including Services, Jobs, Workflows, Job Runs, and Pods. Logs are filtered based on the provided query parameters.

Parameters

start_ts
typing.Optional[int]
Start timestamp for querying logs, in nanoseconds from the Unix epoch.
end_ts
typing.Optional[int]
End timestamp for querying logs, in nanoseconds from the Unix epoch.
limit
typing.Optional[int]
Max number of log lines to fetch
direction
typing.Optional[LogsSortingDirection]
🔗 LogsSortingDirectionDirection of sorting logs. Can be asc or desc
num_logs_to_ignore
typing.Optional[int]
Number of logs corresponding to the starting timestamp to be ignored.
application_id
typing.Optional[str]
Application ID
application_fqn
typing.Optional[str]
Application FQN
deployment_id
typing.Optional[str]
Deployment ID
job_run_name
typing.Optional[str]
Name of the Job Run for which to fetch logs.
pod_name
typing.Optional[str]
Name of Pod for which to fetch logs.
container_name
typing.Optional[str]
Name of the Container for which to fetch logs.
pod_names
typing.Optional[typing.Union[str, typing.Sequence[str]]]
List of pod names for which to fetch logs.
pod_names_regex
typing.Optional[str]
Regex pattern for pod names to fetch logs.
search_string
typing.Optional[str]
String that needs to be matched
search_type
typing.Optional[LogsSearchFilterType]
🔗 LogsSearchFilterTypeQuery filter type, regex or substring
search_operator
typing.Optional[LogsSearchOperatorType]
🔗 LogsSearchOperatorTypeComparison operator for filter. equal or not_equal

Returns

GetLogsResponse
GetLogsResponse
🔗 GetLogsResponseSuccessfully retrieved logs for the workload

Usage

from truefoundry import TrueFoundry

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

client.logs.get(
    start_ts="value",
    end_ts="value",
    limit=10,
    direction="value",
    num_logs_to_ignore="value",
    application_id="application_id_value",
    application_fqn="value",
    deployment_id="value",
    job_run_name="value",
    pod_name="value",
    container_name="value",
    pod_names="value",
    pod_names_regex="value",
    search_string="value",
    search_type="value",
    search_operator="value",
)
I