Filtering Traces
Filtering hides spans without discarding the graph relationships that still explain the visible
trace. The original normalized data stays immutable; filter state lives in TraceGraph.
Filter flow
- Start from the loaded graph.
- Evaluate text filters and configured topology filters.
- Record filter provenance in row-aligned process tables.
- Build the visible graph projection used by layout and rendering.
- Contract parent and dependency paths onto surviving visible representatives.
spanFilter accepts literal prefixes and explicit regular expressions:
const filters = ['rpc.request_', 'packages/example_tracing/base.py', '/^executeRpc-\\d+$/'];
Filter families
- name and regexp filtering marks spans matched by text rules
- source filtering marks spans matched by source metadata
- topology filtering contracts structures such as overlapping parent spans or similar-duration chains
- time-window hiding is separate from graph filtering and should come from application window metadata
Why refs matter
Use SpanRef when checking filtered state. Source span IDs may collide across processes, while a ref
identifies one exact loaded row.
Useful TraceGraph calls include:
spanIsFiltered(...)spanFilterReason(...)getTraceSpanFilteredParentRef(...)getTraceSpanFilterNavigation(...)searchSpans(...)
Invalidation
Rebuild TraceGraph when source data or filter semantics change. Do not rebuild it for collapse
toggles, timing-key changes, or pure render settings. Those belong to layout, geometry, or render
updates.
Read TraceGraph for the runtime methods and TraceVisSettings for settings invalidation groups.