Skip to main content

Filtering

Filters narrow down the rows that go into each aggregation and group. They are AND-combined; there is no OR-group support. The server enforces a per-field operator allow-list, so the exact subset of operators you can use depends on the field.

Filter object structure

For standard datasource fields, use fieldName:
{
    "fieldName": "agentName",
    "operator": "IN",
    "value": ["support-bot", "research-agent"]
}

Filterable fields

The agent-specific string fields (agentName, agentFramework, agentServerType) accept the narrow set IN, NOT_IN, STRING_CONTAINS, STRING_STARTS_WITH, STRING_ENDS_WITH. IS_NULL is not supported on these fields; sending it returns 400 Bad Request with Field "agentName" does not support operator "IS_NULL". EQUAL and NOT_EQUAL are only supported on subject fields (userEmail, virtualAccount) and conversationID.
FieldTypeAllowed operators
agentNamestringIN, NOT_IN, STRING_CONTAINS, STRING_STARTS_WITH, STRING_ENDS_WITH
agentFrameworkstringIN, NOT_IN, STRING_CONTAINS, STRING_STARTS_WITH, STRING_ENDS_WITH
agentServerTypestringIN, NOT_IN, STRING_CONTAINS, STRING_STARTS_WITH, STRING_ENDS_WITH
isFailurebooleanEQUAL
httpStatusCodenumberEQUAL, NOT_EQUAL, IN, NOT_IN, GREATER_THAN, LESS_THAN, GREATER_THAN_EQUAL, LESS_THAN_EQUAL, IS_NULL
userEmailstringfull string operator set (no IS_NULL)
virtualAccountstringfull string operator set (no IS_NULL)
teamarrayARRAY_HAS_ANY, ARRAY_HAS_NONE
latencyMsnumberGREATER_THAN, LESS_THAN, GREATER_THAN_EQUAL, LESS_THAN_EQUAL, BETWEEN
conversationIDstringfull string operator set
metadataKey / metadata.<key>stringfull string operator set

Filter operators

String field operators

OperatorDescriptionExample value
EQUALExact match"alice@example.com"
NOT_EQUALNot equal to value"bot@example.com"
INMatch any value in the list["langgraph", "crewai"]
NOT_INExclude values in the list["deprecated-framework"]
STRING_CONTAINSContains substring"graph"
STRING_NOT_CONTAINSDoes not contain substring"internal"
STRING_STARTS_WITHStarts with prefix"prod-"
STRING_NOT_STARTS_WITHDoes not start with prefix"internal-"
STRING_ENDS_WITHEnds with suffix"-v1"
STRING_NOT_ENDS_WITHDoes not end with suffix"-deprecated"
IS_NULLtrue matches rows where the field is unset; false matches rows where it is settrue

Numeric field operators

OperatorDescriptionExample value
EQUALExact match200
NOT_EQUALNot equal to value200
INMatch any value in the list[200, 404, 500]
NOT_INExclude values in the list[200]
GREATER_THANStrictly greater than499
LESS_THANStrictly less than300
GREATER_THAN_EQUALGreater than or equal to400
LESS_THAN_EQUALLess than or equal to299
BETWEENBetween two values (inclusive)[500, 5000]
IS_NULLtrue matches rows where the field is unset; false matches rows where it is settrue

Boolean field operators

OperatorDescriptionExample value
EQUALExact matchtrue

Array field operators (used by team)

OperatorDescriptionExample value
ARRAY_HAS_ANYMatch if the array contains any of the values["team-alpha", "team-beta"]
ARRAY_HAS_NONEMatch if the array contains none of the values["excluded-team"]

Custom metadata filtering and grouping

Every datasource supports filtering and grouping by custom request-metadata keys:
  • Filter: { "metadataKey": "environment", "operator": "EQUAL", "value": "prod" }
  • Group: include "metadata.environment" in the groupBy array.
Metadata fields are treated as strings; use the String field operators table.

Implicit team unnesting

When team is in groupBy (or used as the column of an aggregation), the server transparently UNNESTs the Teams array CTE before applying RBAC. Callers don’t need to do anything extra. Rows whose Teams array is NULL or empty drop out naturally.

Combining multiple filters

Filters are AND-combined:
{
    "startTs": "2026-04-21T00:00:00.000Z",
    "endTs": "2026-04-22T00:00:00.000Z",
    "datasource": "agentMetrics",
    "type": "distribution",
    "filters": [
        {"fieldName": "agentFramework", "operator": "IN", "value": ["langgraph"]},
        {"fieldName": "agentName", "operator": "IN", "value": ["support-bot", "research-agent"]},
        {"fieldName": "latencyMs", "operator": "BETWEEN", "value": [100, 10000]},
        {"fieldName": "team", "operator": "ARRAY_HAS_ANY", "value": ["team-alpha"]}
    ],
    "groupBy": ["agentName", "isFailure"]
}