Skip to main content

Why Filter Spans

When using third-party frameworks that emit their own OpenTelemetry spans (e.g., Google A2A, PydanticAI internals, LangChain sub-components), those spans can clutter your traces with low-level transport or framework details that aren’t useful for debugging your application. The span_name_filters parameter on HoneyHiveTracer.init() lets you control which spans are sent to HoneyHive. Filtered spans are dropped before any enrichment or export, so they have zero overhead.
For full parameter details, see the span_name_filters parameter in the SDK reference.

Exclude Filter

Drop spans whose name starts with a given prefix. All other spans are kept.
This drops all spans with names starting with a2a.client.transports (e.g., a2a.client.transports.jsonrpc.JsonRpcTransport.send_message) while keeping useful spans like agent run, chat gpt-4o-mini, etc.

Include Filter

Only keep spans whose name starts with one of the given prefixes. All other spans are dropped.
This keeps only spans whose names start with pydantic-ai or chat, dropping everything else.

Combining Include and Exclude

When both include and exclude are specified, a span must match at least one include prefix and not match any exclude prefix.
This keeps all a2a.* spans except the noisy transport internals.

Filter Entry Format

Each filter entry is a dictionary with two keys:

Common Filters


Debugging

When verbose=True is set on HoneyHiveTracer.init(), filtered spans are logged at debug level so you can verify your filters are working as expected.
To disable automatic HTTP request tracing entirely, set HH_DISABLE_HTTP_TRACING=true (or pass disable_http_tracing=True to HoneyHiveTracer.init()). See Environment Variables for the full list of configuration options.

Sampling

Control which requests get traced in high-volume applications

Tracer Initialization

Where to initialize the tracer for scripts, Lambda, and web servers

Tracing Introduction

Data model and architecture overview