Skip to main content
Applies to:


Summary Goal: Add custom metrics like metrics.my_custom_metric to monitoring charts using BTQL syntax when they don’t appear in the default dropdown. Features: Monitor dashboards, custom BTQL measures, code input mode for chart configuration.

Configuration Steps

Step 1: Enable trace level metrics feature flag

Navigate to Settings > Feature flags and toggle on “Trace level metrics”.

Step 2: Verify measure syntax in SQL sandbox

Test your measure query in the BTQL/SQL sandbox to confirm it returns data before adding to a chart.
from: project_logs('<my project id>')
measures: percentile(metrics.my_custom_metric, 0.95)

Step 3: Switch to custom measure input mode

In Monitor > Create chart, click the code button (</>) next to the Measure dropdown to enable custom BTQL input.

Step 4: Enter custom BTQL measure

Type your measure using BTQL syntax in the text box that replaces the dropdown.
percentile(metrics.my_custom_metric, 0.95)

image-db9698ad.png

Step 5: Configure chart settings

Set Group by to your metadata field and Unit to Cost, then adjust the time range to include periods with data.

Additional Notes

The default dropdown only displays scores and metrics that exist in the selected timeframe. Custom measures can reference any valid BTQL field but must use the measures statement syntax. Charts display empty if no data exists for the specified measure and timeframe.