This capability is currently in public preview. It is available to every customer and Fiddler responds promptly to issues, but it is not yet covered by an SLA and its APIs may still change.
Overview
GenAI charts come with built-in filters such as Agent Name, Span Type, Latency, Token Count, Attribute, and Evaluator. When you need a condition those filters can’t express, write a custom filter: a boolean expression in Fiddler Query Language (FQL) that each span must match. A custom filter you don’t save is an inline filter: it’s stored with the chart and applies only to that chart. Save a custom filter to the filter library to reuse it on other charts. A chart stores a link to the saved filter rather than a copy, so every chart that uses it applies the same definition. Custom filters, inline or saved, apply to GenAI charts only. They aren’t available in Explorer yet.Add a Custom Filter to a Chart
- Open a GenAI chart and add a filter to a query.
- Select Custom Filter. The picker lists the saved filters you can apply to this chart.
- Do one of the following:
- Select a saved filter to apply it. The editor shows its definition and description.
- Select New Custom Filter and write an FQL expression in the editor.
Then either:
- Apply it to this chart only, as an inline filter.
- Save it to the filter library to reuse it in your project or organization.
- Save the chart.
A query uses either any number of built-in filters or a single custom filter, inline or saved, not both.
Adding a custom filter to a query removes its built-in filters,
and adding a built-in filter removes its custom filter.
To combine conditions, write them all in one custom filter.
Save a Custom Filter
To save an inline filter to the filter library, select Save Filter in the custom filter editor. In the Create Saved Filter dialog:- Enter a Filter Name and an optional description.
- Under Access & Permissions, choose who can use the filter:
- Project Level (the default) — available only to charts in this chart’s project.
- Global (Organization) — available to charts in every project of the organization.
- Review the Filter Definition and select Create Filter.
Manage the Filter Library
Select Saved Filters in the sidebar, or Manage filters in the custom filter picker, to open the filter library. From the library you can:- Search saved filters.
- Add Saved Filter — create a filter from scratch, for the organization or a project you choose.
- Duplicate — copy an existing filter as a starting point for a new one.
- Delete — remove a filter permanently.
Permissions
Saved filters share permissions with agentic custom metrics. See the Global Agentic Custom Metrics and Saved Filters and Project-Scoped Agentic Custom Metrics and Saved Filters rows in Role-Based Access.- Global (Organization) filters are created with an organization role.
- Project Level filters are created with a role on that project; an organization role alone isn’t enough, except for Org Admins when Org Admin access to all projects is turned on.
- You see project filters only for projects where you have a role, with the same Org Admin exception.
Filter Syntax
A filter is an FQL expression that evaluates totrue or false for each span.
It references span data with four functions:
attribute() takes the same arguments as in custom metrics.
span() accepts these field names:
span_id, trace_id, parent_span_id, session_id, span_name, span_type, status_code, status_message, duration, agent_id, and agent_name.
duration is in nanoseconds:
span(name='duration') > 2000000000 matches spans longer than 2 seconds.
To filter on latency alone, the built-in Latency filter lets you choose the unit instead.
annotation() reads an annotation score.
source is human (the default), llm, or code.
Compare a numeric score with a number, a thumbs-up style score with true or false,
and a categorical or text score with a string:
Operators and Functions
- Comparisons:
==,!=,<,<=,>,>= - Membership:
in(attribute('model'), 'gpt-4o', 'gpt-4o-mini'),not_in(...) - Missing values:
is_null(...),is_not_null(...) - Logic:
and,or,not(...) - Arithmetic and row functions, such as
+,-,*,/,abs(),length(), andsubstring()
average() or count() are not allowed, because a filter is evaluated on each span.
if(), to_string(), greatest(), and least() are also not allowed.
Combining Conditions
Each condition reads exactly one field: one attribute, one evaluator output, one annotation score (persource),
or the built-in span fields, which all count as one field because they are columns of the same span.
- Conditions on the same field can be combined with
and,or, andnot(...). - Conditions on different fields can be combined only with a top-level
and.
Limitations
- One field per condition.
A condition can’t compare two fields or combine them with arithmetic,
and conditions on different fields combine only with a top-level
and. Only the built-in span fields can be combined withoracross fields; two different attributes, evaluator outputs, or annotation scores can’t. - Compare every field explicitly.
Write
evaluator(name='Safety', output='Is Toxic') == true, notevaluator(name='Safety', output='Is Toxic'). Every condition must reference a field, so... or trueisn’t valid. - Missing values.
is_null()andis_not_null()don’t work onattribute(), because a span that lacks an attribute has no value to test.is_null()onannotation()is accepted but matches no spans.!=andnot_in()on an attribute don’t match spans that lack the attribute. - No time fields.
Span start and end times aren’t available in
span(); use the chart’s time range instead. - One custom filter per query. A query can have several built-in filters or a single custom filter, but not both, and it can’t apply two custom filters at once, whether inline or saved. To combine conditions, write them all in one expression; copying a saved filter’s definition into a new expression makes it an inline filter, which no longer follows the saved filter.
- Saved filters can’t be edited. Duplicate the filter, edit the copy, and switch your charts to it.
Examples
Production LLM spans:Safety evaluator:
Manage Saved Filters with the API
The GenAI Filters REST API lists, creates, reads, and deletes saved filters.Related Resources
- Fiddler Query Language (FQL) — operators and functions shared by filters and custom metrics
- Custom Metrics for Agentic Applications — the
attribute()function and semantic names - Explorer — filter individual traces and spans
- Agentic Observability — overview of dashboards, metrics, and integrations