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

# Export missing child spans

export const plans_0 = "Any"

export const deployments_0 = "Braintrust-hosted, Self-hosted"

export const data_plane_version_0 = undefined

export const use_case_0 = "Use case - Cloud storage export when detailed span-level data is required"

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

## Summary

Cloud storage export automations configured with `Logs (traces)` only export one row per trace containing aggregated summary data, not the individual child spans within each trace. This occurs because `Logs (traces)` runs a summary query that consolidates all spans into a single root span with aggregated metrics. To export all child spans, change the configuration to `Logs (spans)` or use a custom BTQL query for more granular control.

## Resolution Steps

### If you need all child spans in your export

#### Step 1: Go to data management settings

Go to **<Icon icon="settings-2" /> Settings** > [**<Icon icon="database-zap" /> Data management**](https://www.braintrust.dev/app/~/configuration/data-management).

#### Step 2: Edit the export automation

Click on your existing automation to edit it.

#### Step 3: Change data export type

Under **Data to export** , select `Logs (spans)` instead of `Logs (traces)`.

#### Step 4: Save and verify

Click **Save** and wait for the next export interval to verify child spans are included.

### If you need both summary metrics and child spans

#### Step 1: Use a custom BTQL query

Select `Custom BTQL query` as the data export type.

#### Step 2: Query both traces and spans

Create separate exports or use a query that includes the specific fields you need from spans.

```text theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
select: id, span_id, parent_id, input, output, scores, metadata
from: project_logs('your-project-id') spans
filter: created >= now() - interval '1 day'

```

## Understanding Export Types

### Logs (traces)

Exports one row per trace with aggregated scores and metrics on the root span only. Use for high-level trace analysis. See [summary spans documentation](/reference/sql#summary).

### Logs (spans)

Exports one row per span, including all child spans. Use for detailed debugging and span-level analysis.

### Custom query

Define exactly what data to export using SQL or BTQL for full control over output.

## Notes

* The export path cannot be changed after the automation is created.
* On data plane v2.0 and earlier, each export interval processed up to 100,000 rows (traces or spans) and files were organized by the automation's run date rather than the records' creation date. On newer data planes there is no per-run row cap, and files are Hive-partitioned by the row's transaction date (`date=YYYY-MM-DD/`). See the main [export docs](/admin/automations/export-to-cloud-storage) for more.
