Skip to content

Conditions

Adding condition groups to a rule

A rule’s matching logic lives in its Condition Groups section, on the rule’s detail page. Conditions are organized into groups: each group has its own AND/OR operator for the conditions inside it, and the rule’s top-level Group Operator (set when you created the rule, editable from Edit Details) decides how the groups themselves are combined.

  • On a rule with no conditions yet, you’ll see “No condition groups yet.” and an Add First Group button.
  • On a rule that already has groups, click Add Group to add another one.
  • Inside a group, click Add Condition to add a condition. Each group shows its own AND/OR choice, labeled “within group”, for combining the conditions inside it.
  • When you’re done, click Save Conditions to persist your changes.

Each condition has three parts:

  • Field - a dropdown. You choose from a fixed list of fields (there’s no way to type an arbitrary custom field name).
  • Operator - a dropdown whose options depend on the field’s data type (string or number - see below).
  • Value - a text input. For fields that commonly take one of a known set of real-world values, you’ll see suggestions labeled “Top 100 values from traces. Press Enter to add a custom value.”

All fields come from your trace/telemetry data. The number fields are marked below; everything else is a string field.

FieldType
Service Namestring
Span Namestring
Span Kindstring
Duration (ms)number
Status Codestring
Deployment Envstring
Gen AI Systemstring
Modelstring
Input Tokensnumber
Output Tokensnumber
Total Cost ($)number
Temperaturenumber

For example, Model is the model name reported by your LLM calls, and Total Cost ($) is the cost recorded for a request.

OperatorDescription
equalsExact match
not_equalsDoes not match
containsSubstring match
not_containsSubstring not present
starts_withPrefix match
ends_withSuffix match
regexRegular expression match
inValue is one of a comma-separated list
not_inValue is not one of a comma-separated list
OperatorDescription
equalsExact numeric match
not_equalsDoes not match numerically
gtGreater than
gteGreater than or equal to
ltLess than
lteLess than or equal to
betweenInclusive range, entered as min,max

Say you want a rule to match requests to a specific, more expensive model where the cost is also high - a candidate for a cost alert:

  1. Click Add First Group (or Add Group if the rule already has one).
  2. Leave the group’s “within group” operator on AND.
  3. Click Add Condition, choose Field = Model, Operator = equals, Value = the model name (e.g. gpt-4).
  4. Click Add Condition again, choose Field = Total Cost ($), Operator = gt, Value = 1000.
  5. Click Save Conditions.

This group now matches any request where Model equals your chosen model AND Total Cost is greater than 1000. If you add a second group, the rule’s top-level Group Operator decides whether both groups must match (AND) or either one is enough (OR).