Skip to main content
You don’t need every span. Filter out the noise and ship the useful bits. LangWatch lets you keep AI and business spans while dropping framework chatter.
Introduced in langwatch@0.8.0.

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

  • Nothing 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 is powerful but slower and harder to read.