Skip to main content

Overview

Custom Metrics and Segments are defined using the Fiddler Query Language (FQL), a flexible set of constants, operators, and functions which can accommodate a large variety of metrics.

Definitions

FQL Rules

  • Column names can be referenced by name either with double quotes (“my_column”) or with no quotes (my_column).
  • Single quotes (’) are used to represent string values.

Data Types

FQL distinguishes between three data types:

Constants

Operators

Constant functions

Row-level functions

Row-level functions can be applied either to a single value or to a column/row expression (in which case they are mapped element-wise to each value in the column/row expression).

Aggregate functions

Every Custom Metric must be wrapped in an aggregate function or be a combination of aggregate functions.
min(x) / max(x) vs least(...) / greatest(...): min(x) and max(x) aggregate a single row-level expression across rows (e.g., min(column1) returns the smallest value of column1 across all rows in the time window). least(...) and greatest(...) compare multiple aggregate results and return the smallest or largest among them (e.g., least(sum(col1), sum(col2)) compares two already-computed sums).
Built-in metric functions are available for ML models only (classification, regression, and ranking tasks). They are not supported in custom metrics for agentic or GenAI applications. For agentic applications, use the attribute() function with aggregate functions instead — see Custom Metrics for Agentic Applications.

Built-in metric functions