Skip to main content

Filters

Latitude uses a universal filter system across the platform. The same filters you use to search traces also power evaluation triggers and annotation queue configuration. Learn it once, use it everywhere.

How Filters Work

A filter is a set of field conditions. All conditions within a field are AND’d together, and all fields are AND’d across each other. For example, “Status is ERROR and Cost is greater than 100 microcents” returns only traces matching both criteria. Filters are available from the toolbar on the Traces page, and appear in the configuration UI for evaluation triggers and annotation queues.

Available Filter Fields

FieldDescriptionExample
StatusTrace completion status: OK, ERROR, or UNSETstatus in [error]
NameRoot span name (the path you set in capture())name eq "invoke_agent"
Session IDFilter to a specific multi-turn sessionsessionId eq "session-abc"
User IDEnd-user identifier from telemetry metadatauserId eq "user-42"
TagsCustom tags attached to spanstags in ["production", "canary"]
ModelsLLM models used in the tracemodels in ["gpt-4o"]
ProvidersLLM providers calledproviders in ["openai"]
ServicesOpenTelemetry service namesserviceNames in ["api-server"]
CostTotal cost in microcentscost gte 100
DurationEnd-to-end duration in nanosecondsduration gte 5000000000
TTFTTime to first tokenstartTime gte ...
Span CountNumber of spans in the tracespanCount gte 10
Error CountNumber of errored spanserrorCount gte 1
Tokens InputTotal input tokens across LLM callstokensInput gte 1000
Tokens OutputTotal output tokens across LLM callstokensOutput gte 500
MetadataCustom key-value metadata your application sendsmetadata.env eq "production"

Operators

Filters support 10 operators:
OperatorMeaningWorks With
eqEqualsAll fields
neqNot equalsAll fields
gtGreater thanNumeric fields
gteGreater than or equalNumeric fields
ltLess thanNumeric fields
lteLess than or equalNumeric fields
inValue is in setStatus, tags, models, providers, services
notInValue is not in setStatus, tags, models, providers, services
containsSubstring match (case-insensitive)Text fields, metadata
notContainsSubstring does not matchText fields, metadata

Custom Metadata Filters

Your application can send structured metadata with its telemetry. Filter on any metadata field using dot-notation:
  • metadata.env: top-level key
  • metadata.runtime.region: nested keys (up to 12 levels deep)
Metadata filters support all operators, so you can filter for exact matches, ranges, set membership, and substring searches on your custom fields.

Combining Filters

All active filters combine with AND logic. Common combinations:
  • Status = ERROR and Cost > 100: find expensive failures
  • Models = gpt-4o and Duration > 5s: find slow GPT-4o traces
  • Metadata environment = production and Error Count > 0: find production errors
  • Tags in ["canary"] and Tokens Output > 2000: find verbose canary responses

Where Filters Are Used

FeatureHow Filters Are Used
Trace dashboardInteractive filtering from the toolbar
Evaluation triggersDefine which traces an evaluation monitors
Live annotation queuesDefine which traces automatically enter a queue
Score analyticsNarrow analytics dashboards to specific trace subsets
When you configure an evaluation trigger or live annotation queue, you’re building a filter using this same system. An empty filter means “match all traces.”

Next Steps