View logs
To view logs, navigate to the Logs tab in the appropriate project in the Braintrust UI. Logs are automatically updated in real-time as new traces are logged.
Filtering logs
You can filter logs by tags, time range, and other fields using the Filter menu.
Create custom columns
Create custom columns to extract specific values from input
, output
, expected
, or metadata
fields.
Braintrust Query Language (BTQL)
You can also filter by arbitrary subfields using Braintrust Query Language syntax.
Here are a few examples of common filters:
Description | Syntax |
---|---|
Logs older than the past day | created < CURRENT_DATE - INTERVAL 1 DAY |
Logs with a user_id field equal to 1234 | metadata.user_id = '1234' |
Logs with a Factuality score greater than 0.5 | scores.Factuality > 0.5 |
Monitor page
To monitor your logs select Go to monitor on the right-hand side of the Logs page. This page shows aggregate values for latency, token count, time to first token, cost, and scores for logs.
Select the Group by dropdown menu to group the data shown using metadata fields.
Querying through the API
For basic filters and access to the logs, you can use the project logs endpoint. This endpoint supports the same query syntax as the UI, and also allows you to specify additional fields to return.
For more advanced queries, you can use BTQL endpoint.
Tags
Braintrust supports curating logs by adding tags, and then filtering on them in the UI. Tags naturally flow between logs, to datasets, and even to experiments, so you can use them to track various kinds of data across your application, and track how they change over time.
Configuring tags
Tags are configured at the project level, and in addition to a name, you can also specify a color and description. To configure tags, navigate to the Configuration tab in a project, where you can add, modify, and delete tags.
Adding tags in the SDK
You can also add tags to logs using the SDK. To do so, simply specify the tags
field when you log data.
Tags can only be applied to top-level spans, e.g those created via traced()
or logger.startSpan()
/ logger.start_span()
. You cannot apply tags to
subspans (those created from another span), because they are properties of the
whole trace, not individual spans.
You can also apply tags while capturing feedback via the logFeedback()
/ log_feedback()
method.
Filtering by tags
To filter by tags, simply select the tags you want to filter by in the UI.