Skip to main content
Applies to:
  • Plan:
  • Deployment:

Summary

Goal: Filter and inspect metadata array elements by index in logs and experiments. Features: SQL array indexing, custom columns.

Configuration steps

Step 1: Use YAML or JSON views to navigate arrays

YAML and JSON views render array items sequentially for easier navigation.
  1. Open a log row and locate the metadata field.
  2. Switch the field’s render mode to YAML or JSON.
  3. Use Ctrl+F / Cmd+F to search within the rendered text.

Step 2: Create custom columns for specific array indices

Surface individual array elements as sortable, filterable columns.
  1. Select Display > + Add custom column.
  2. Name the column (e.g., prompt_0_role).
  3. Enter a SQL expression targeting the index:
metadata.gen_ai.prompt[0].role
metadata.gen_ai.prompt[1].content
Once created, filter and sort on these columns directly in the table. Reference: View logs – custom columns

Step 3: Filter by array index using SQL

Use the filter bar to query specific array positions. Arrays are 0-based and support negative indices.
-- Match a specific role at index 0
WHERE metadata.gen_ai.prompt[0].role = 'system'

-- Surface a single element as a column
SELECT metadata.gen_ai.prompt[5] AS item_5
Reference: SQL queries

Limitations

The metadata viewer has no built-in index jump or next/prev navigation to iterate through arrays, and the steps above are currently to filter and inspect array elements.