Skip to main content

LogsClient

adaline.logs is the read-side counterpart to the Monitor write path. It lists recent traces as lightweight metadata and exposes two nested sub-clients for typed search over traces and spans. Every method is async.
The write-side — buffering and flushing traces and spans — lives on the Monitor, Trace, and Span classes, created via adaline.init_monitor(). LogsClient is strictly read / retroactive patch.

Access

from adaline.main import Adaline

adaline = Adaline()
logs = adaline.logs  # LogsClient
The class is also exported directly:
from adaline.clients import LogsClient

Sub-clients

AttributeClientCovers
adaline.logs.tracesLogTracesClientTyped trace search and retroactive trace updates
adaline.logs.spansLogSpansClientTyped span search with full span bodies
Types from adaline_api:
from adaline_api.models.list_logs_response import ListLogsResponse

list()

List log traces in a project — lightweight metadata only (no span bodies).
async def list(
    *,
    project_id: str,
    started_after: Optional[int] = None,
    started_before: Optional[int] = None,
    status: Optional[LogStatus] = None,
    name: Optional[str] = None,
    reference_id: Optional[str] = None,
    session_id: Optional[str] = None,
    sort: Optional[LogSort] = None,
    limit: Optional[int] = None,
    cursor: Optional[str] = None,
    filters: Optional[str] = None,
) -> ListLogsResponse

Parameters

NameTypeRequiredDescription
project_idstrYesProject to list traces for.
started_after / started_beforeOptional[int]NoUnix millisecond bounds.
statusOptional[LogStatus]No"success", "failure", "aborted", "cancelled", "pending", "unknown".
nameOptional[str]NoFilter by trace name.
reference_idOptional[str]NoFilter by client-supplied reference ID.
session_idOptional[str]NoFilter by session ID.
sortOptional[LogSort]No"startedAt:asc" or "startedAt:desc".
limitOptional[int]NoPage size (1-200, default 50).
cursorOptional[str]NoCursor from a previous response.
filtersOptional[str]NoJSON-encoded filter array. See Export Logs.
LogStatus and LogSort are string-alias enums re-exported from adaline.clients.retry.

Returns

ListLogsResponse with { data: list[TraceMetadata]; pagination: Pagination }. Span bodies are not included.

Example

import time

response = await adaline.logs.list(
    project_id="project_abc123",
    status="failure",
    started_after=int((time.time() - 24 * 3600) * 1000),  # last 24 hours
    sort="startedAt:desc",
    limit=100,
)

for trace in response.data:
    print(trace.id, trace.name, trace.status)

See Also