Skip to main content
A trace filter decides which spans the LangWatch exporter sends. Use filters to keep AI and business spans while dropping framework chatter.

Defaults

By default we exclude HTTP request spans.
Default is equivalent to { filters: [{ preset: "excludeHttpRequests" }] }. You can set filters: null or filters: [] to send all spans.

Quick start

Custom filters

Use include to keep matches; use exclude to drop matches. Criteria support:
  • instrumentationScopeName
  • name

Matching

Matchers are case-sensitive unless you set ignoreCase: true.

Logic

  • OR within a field: multiple matchers are alternatives
  • AND across fields: all specified fields must match

Pipelines (sequential AND)

Filters run in order; each step narrows the set.

Integrate with setupObservability

Via BatchSpanProcessor

Troubleshooting

  • No spans exported: try filters: [], then add rules back
  • Too much noise: apply excludeHttpRequests, add specific exclude rules
  • Case surprises: add ignoreCase: true where needed
  • Check values: log span.name and span.instrumentationScope.name in dev

Types

Use simple matchers (equals, startsWith) where possible; regex matches more patterns but is slower and harder to read.
Last modified on October 29, 2026