> ## Documentation Index
> Fetch the complete documentation index at: https://docs.braintrust.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Metadata filtering in custom views shows partial data

> [!NOTE]
>
> **Applies to:**
>
> * Plan - Any
> * Deployment - Braintrust-hosted
> *
> * Use case - Custom views and filtering in monitor dashboard with hierarchical trace structures from SDK integrations

## Summary

**Issue:** Custom views in the monitor dashboard show partial data when filtering by metadata fields added to root traces. Child spans from `openai-agents-sdk-js` integration are missing from filtered results.

**Cause:** Metadata added to root traces does not automatically propagate to child spans for filtering purposes—metadata indexing is span-level, not inherited.

**Resolution:** Add metadata to all relevant child spans during logging, or use trace ID filtering to examine full trace hierarchies.

## Resolution Steps

### If you need to filter entire trace hierarchies by metadata

#### Step 1: Add metadata to child spans

Include the same metadata fields on all child spans when logging, not just the root trace.

```javascript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
// Add metadata to both root and child spans
const trace = braintrust.startTrace({ metadata: { feature: "checkout" } });
const span = trace.startSpan({ metadata: { feature: "checkout" } });

```

#### Step 2: Filter in custom views

Apply your metadata filter in the custom view—all spans with the metadata will now appear.

### Otherwise, if you want to view full traces matching root metadata

#### Step 1: Filter by metadata to find root traces

Apply your metadata filter in the custom view to identify matching root traces.

#### Step 2: Use trace ID to view complete hierarchy

Click on a matching root trace to open the full trace tree with all child spans.

### Alternative: Use trace-level grouping

#### Step 1: Configure custom view grouping

Set the view to group by trace ID instead of filtering individual spans.

#### Step 2: Apply trace-level filters

Filter using fields that exist on root traces to see complete trace groups.

## Related documentation

Fields aren't inherited from a trace's root span down to its child spans. For why that drops rows and how to work around it, see [Filters match one span at a time](https://docs.braintrust.dev/reference/sql/filtering.md#filters-match-one-span-at-a-time).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.