Skip to main content

LogSpansClient

adaline.logs.spans searches individual spans and returns their full payloads — content, parsed content, attributes, tags, status, and timestamps. Use this when a trace-level search isn’t granular enough for the filter you need.

Access

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

const adaline = new Adaline();
const spans = adaline.logs.spans; // LogSpansClient
The class is also exported directly:
import { LogSpansClient } from '@adaline/client';
Types from @adaline/api:
import type {
  SearchLogSpansRequest,
  SearchSpansResponse,
} from '@adaline/api';

Paginated span search with typed filter objects. Returns full span payloads — content, attributes, parsedContent, tags, status, timestamps — so you can filter by model, provider, promptId, or any attribute.
search(options: { query: SearchLogSpansRequest }): Promise<SearchSpansResponse>

Parameters

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

Returns

Promise<SearchSpansResponse> with { data: SpanRow[]; pagination: Pagination }. Each SpanRow includes the full content (model/tool/retrieval/etc.) and parsed attributes.

Example

const { data, pagination } = await adaline.logs.spans.search({
  query: {
    projectId: 'project_abc123',
    filters: [
      { type: 'model', column: 'model', operator: 'equals', value: 'gpt-4o' },
      { type: 'status', column: 'status', operator: 'equals', value: 'failure' },
    ],
    sort: 'startedAt:desc',
    limit: 50,
  },
});

for (const span of data) {
  console.log(span.id, span.name, span.content.type);
}

See Also