ui/src/assets/data_explorer/node_info/metrics.md
Purpose: Define trace-based metrics from your query results. This node packages your data into a TraceMetricV2TemplateSpec proto that can be exported and used in trace analysis pipelines. Each value column becomes a separate metric, and all remaining columns become dimensions.
How to use:
Connect an input: This node requires a source of data (e.g., from a Table Source or after filtering/aggregating data)
Set Metric ID Prefix: Give your metric a unique identifier prefix (e.g., cpu_metrics, memory_usage). Each metric is named <prefix>_<column_name>.
Drag columns to Values: The panel shows two lists — Dimensions on the left and Values on the right.
Configure each Value column: For each value column in the Values panel, set:
Configure Dimension Uniqueness: Specify whether dimension combinations are unique:
Dimensions: All columns not in the Values list automatically become dimensions. Use a Modify Columns node before this one to control which columns are present.
Export: Click the "Export" button to generate a textproto representation of your metric template specification. A preview table shows the metric values as they would appear in an actual trace. When there are multiple value columns, each has its own tab in the preview.
Example workflow:
slice table)SUM(dur) and COUNT(*) grouped by process_nameslice_statssum_dur to Values → Unit: Time (nanoseconds), Polarity: Lower is Bettercount to Values → Unit: Count, Polarity: Not ApplicableThis creates two metrics — slice_stats_sum_dur and slice_stats_count — both with process_name as a dimension.
Output: The node passes through input columns unchanged. The metric template specification is generated separately via the Export button.