Skip to main content

LogTracesClient

adaline.logs.traces searches traces with typed column filters — status, time window, name, attributes — and retroactively patches a trace’s status, tags, or attributes after it has already been flushed.

Access

import { Adaline } from '@adaline/client';

const adaline = new Adaline();
const traces = adaline.logs.traces; // LogTracesClient
The class is also exported directly:
import { LogTracesClient } from '@adaline/client';
Types from @adaline/api:
import type {
  SearchLogTracesRequest,
  SearchTracesResponse,
  UpdateLogTraceRequest,
} from '@adaline/api';

Paginated trace search with typed filter objects. Returns full trace metadata filtered by the provided filters — more expressive than logs.list because filters are typed column predicates rather than JSON-encoded strings.
search(options: { query: SearchLogTracesRequest }): Promise<SearchTracesResponse>

Parameters

NameTypeRequiredDescription
querySearchLogTracesRequestYesProject, filters, sort, pagination. See Export Logs for filter grammar.

Returns

Promise<SearchTracesResponse> with { data: TraceRow[]; pagination: Pagination }.

Example

const { data, pagination } = await adaline.logs.traces.search({
  query: {
    projectId: 'project_abc123',
    filters: [
      { type: 'status', column: 'status', operator: 'equals', value: 'failure' },
      { type: 'startedAt', column: 'startedAt', operator: 'gte', value: Date.now() - 3600_000 },
    ],
    sort: 'startedAt:desc',
    limit: 100,
  },
});

for (const trace of data) {
  console.log(trace.id, trace.name, trace.status);
}

update()

Retroactively patch a trace’s status / endedAt and create or delete tags and attributes. Locate the trace by traceId or referenceId (at least one required). Useful for asynchronously marking a trace as succeeded / failed after some out-of-band signal.
update(options: { trace: UpdateLogTraceRequest }): Promise<unknown>

Parameters

NameTypeRequiredDescription
traceUpdateLogTraceRequestYes{ traceId? | referenceId?, status?, endedAt?, tags?, attributes? } — see OpenAPI for the full shape.

Returns

Promise<unknown> — an ack from the server (no typed shape; confirms the update landed).

Example

await adaline.logs.traces.update({
  trace: {
    referenceId: 'user-session-123',
    status: 'success',
    attributes: {
      resolved: 'by-support',
    },
  },
});

See Also