Bulk export supports Amazon S3 only. Google Cloud Storage, Azure Blob Storage, and other S3-compatible destinations aren’t supported. This limitation applies to bulk export; bring your own bucket (BYOB) features have separate storage-provider support.
Prerequisites
To configure bulk export, a deployment administrator must have the following:- A Weave Trace server with bulk export support and connectivity to ClickHouse and Redis.
- An existing Amazon S3 bucket and an optional prefix for export files.
- An AWS administrator who can configure AWS Identity and Access Management (IAM) roles and storage permissions.
- A ClickHouse identity that can assume the customer export role.
- A Weave Trace AWS identity that can write and read export metadata.
- Your deployment’s trace API base URL and a Forge API key.
curlfor the API examples and the AWS CLI for file downloads.
Configure Amazon S3 storage
The deployment administrator configures one destination for exports. Individual API requests don’t select a bucket or prefix.Select a bucket and prefix
Use an S3 URI in the forms3://BUCKET_NAME/PREFIX. Replace BUCKET_NAME with your bucket name and PREFIX with an optional prefix. For example:
/ uses the bucket root. Weave normalizes leading, trailing, and repeated slashes. Don’t include credentials, query parameters, fragments, wildcard characters (*, ?, {, or }), or . and .. path segments.
Export files use the exports/ directory beneath the configured prefix. Review bucket lifecycle rules, encryption, and network restrictions with your AWS administrator.
Configure the ClickHouse role
ClickHouse and Weave Trace use separate AWS identities. ClickHouse writes the Parquet files. Weave Trace writes the final success manifest and reads it to report the status of completed jobs. To create the customer IAM role that ClickHouse assumes:-
Find the Amazon Resource Name (ARN) of the AWS principal that ClickHouse uses. This is the principal that your customer IAM role must trust, and it must be able to assume that role. It isn’t the customer role’s ARN that you configure in Weave.
- ClickHouse Cloud: Open the service’s Settings, find Network security information, and copy Service role ID (IAM).
- Self-hosted ClickHouse: Identify the AWS principal used by the ClickHouse server. The ClickHouse Cloud console steps don’t apply to self-hosted servers.
-
Create a customer IAM role with a trust policy for the ClickHouse principal. Replace
CLICKHOUSE_PRINCIPAL_ARNwith that principal’s ARN:clickhouse-trust.json - Configure role-based access for your ClickHouse service by following Accessing S3 data securely. Confirm the trust requirements for your account arrangement. Weave supplies the customer role ARN to the query.
-
Attach an S3 permissions policy to the customer role. Replace
BUCKET_NAMEwith your bucket name andPREFIXwith your configured prefix. If you use the bucket root, removePREFIX/from both the object resource and the prefix conditions:clickhouse-export-policy.json
Configure Weave Trace access
Grant Weave Trace’s existing AWS roles3:PutObject and s3:GetObject on the export objects. Grant s3:ListBucket restricted to the export prefix. Prefix listing helps distinguish a missing manifest from denied access.
Use the deployment’s existing AWS software development kit (SDK) credential source, such as an IAM role for a Kubernetes ServiceAccount. Preserve existing file-storage permissions. The Kubernetes ServiceAccount name alone doesn’t identify the AWS role.
For cross-account buckets, configure the required bucket and identity policies. If you use AWS Key Management Service (AWS KMS) encryption, authorize both identities in the key policy and grant each one kms:GenerateDataKey and kms:Decrypt on the key. If Weave Trace needs the key for its metadata writes, set WF_FILE_STORAGE_AWS_KMS_KEY. If its S3 client needs a region override, set WF_FILE_STORAGE_AWS_REGION.
Before enabling exports, verify that ClickHouse can write a representative Parquet file and that Weave Trace can write and read export metadata.
Configure the deployment
Set the export environment variables on Weave Trace through your deployment’s configuration mechanism. ReplaceBUCKET_NAME, PREFIX, and CUSTOMER_EXPORT_ROLE_ARN with your values:
WF_EXPORT_AWS_ROLE_ARN identifies the customer role that ClickHouse assumes. Both settings are required to start exports. Keep the file-storage setting WF_FILE_STORAGE_URI unchanged. Export storage has no automatic fallback to the deployment’s default bucket.
To detect export queries that are still running, Weave Trace checks the ClickHouse cluster named in WF_CLICKHOUSE_REPLICATED_CLUSTER when set, or the cluster named default otherwise. The selected cluster must include every server that can execute export queries. If the cluster is missing or Weave Trace can’t see its queries, start requests fail with HTTP 503.
Apply the configuration through your normal deployment process. To stop accepting exports, remove the export role setting. Retain the storage URI and permissions needed to look up completed jobs.
Start an export
Set your trace API base URL and credentials. ReplaceINSTANCE_HOST with your deployment hostname and API_KEY with your API key:
/traces, don’t append it again.
To export all supported datasets, replace ENTITY and PROJECT with the entity and project names used in your project URL:
202 with a job ID. The following example shows the response:
Example output
targets:
Check export status
To check a known job, replaceENTITY, PROJECT, and JOB_ID with the scope and job ID from the start request:
A successful calls-only job has a response similar to this example:
Example output
Retrieve export files
Use the artifact URIs returned by the status API. The storage path includes an encoded internal project identifier, which can differ from the project name. For a job that selects all datasets, the output layout is:ARTIFACT_URI with its uri value:
Limitations
Only one export workflow runs at a time for the configured ClickHouse service and database. Another start request receives HTTP409. Requests aren’t queued.
The server counts all selected datasets before writing Parquet. If a dataset exceeds the row cap, the job fails before any dataset writes begin. Execution stops on the first failure.
Deployment administrators can configure these query limits:
Values must be positive integers. These limits don’t reserve CPU or memory. A dataset below the row cap can still exceed the memory budget.
Counts and writes use separate queries. Exports don’t provide a transactionally consistent snapshot across datasets or concurrent writes. Physical row counts can differ from logical call counts in the UI.
Bulk export doesn’t copy referenced media bytes or recursively export referenced table contents. To use externally stored media in Weave, see Reference media in your own bucket (BYOB) using Weave Op. The export isn’t a full deployment backup or a supported restore format.
Troubleshoot an export
Errors include a diagnostic message. Export service errors also include a machine-readabledetail.code:
A worker restart doesn’t resume an export. An export query still running in ClickHouse blocks another export until it stops. An HTTP
503 from a status request means the server couldn’t check the job’s dependencies, not that the job failed.
Failed jobs can leave partial files. The API doesn’t return them as successful artifacts, and it doesn’t automatically delete them. The API has no cancellation or automatic retry operation.
The server writes the final manifest only after all selected datasets succeed. Completed jobs can be recovered from that manifest if Redis job records are unavailable. Failed and intermediate history can be lost with Redis state.
Keep the storage bucket and prefix stable while jobs run and while you need historical lookup. Use bucket lifecycle policies to manage file retention.