Laminar SQL Editor allows you to query all your data stored at Laminar using SQL.
The SQL Editor is currently in beta. Some functionality may change. We value your feedback and suggestions. Please contact us or join our Discord to share your thoughts.
Laminar SQL editor queries data stored in ClickHouse. Queries must be written in ClickHouse SQL. For detailed reference of the syntax, see the reference page.

Features

  • Query all your data stored at Laminar using SQL
  • Write custom complex queries to connect different data within your project
  • Fast analytics on your data, e.g.
    • Detailed breakdown of token count and cost by operation
    • Detailed latency analysis by operation
    • Dig into deeply nested trace data
  • Create custom dashboards
  • Export query results to Laminar datasets or labelling queues
  • Query data via API to connect to your own tools and workflows

Allowed queries

  • Only SELECT queries are allowed.
  • Allowed tables (to select from):
    • spans
    • traces
    • events
    • evaluation_scores
    • evaluation_datapoints
For detailed information about the tables and columns, see the reference page.

Getting started

Prerequisites

  • You must have some data stored at Laminar, such as traces or evaluation results.

Using the SQL Editor

SQL Editor is available in the sidebar. SQL Editor in sidebar on Laminar

Using SQL Query API

You can also run queries directly from the API. It is available at the /v1/sql/query endpoint. Querying via API is identical to using the SQL Editor, you simply pass the query as a parameter. Read the API reference page for more information.

Example query

SELECT
    input,
    output,
    start_time
FROM spans
WHERE start_time BETWEEN now() - INTERVAL '3 days' AND now()
This query will return the input and output of the spans in the last 3 days.

Viewing results

Results are displayed in a table or raw JSON view. JSON View of the results

Exporting results

Once you have selected the results you want to export, click the “Export to Dataset” button. Choose the dataset you want to export to and map the columns to the dataset data, metadata, and target fields. Export to Dataset Learn more about datasets

Next steps

  • Overview – Overview of the Laminar SQL Editor and how to use it
  • Reference – Reference of the table schemas and best practices