Weave uploads trace data in background threads to minimize impact on your application’s performance. However, when using a multiprocessing or task queue system or a worker processes like Celery, Weave loses trace data if the worker process exits before background threads finish uploading traces. To prevent data loss in worker processes, you must ensure that background uploads complete by callingDocumentation Index
Fetch the complete documentation index at: https://wb-21fd5541-john-wbdocs-2044-rename-serverless-products.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
client.flush() or client.finish() before the worker task completes. This helps when working in short‑lived environments like AWS Lambda, Google Cloud Run, or notebooks that exit right after execution.
These methods have different purposes:
weave.flush(): Simple, silent flushing. Recommended when Weave is integrated into worker processes or CI environments.weave.finish(): Includes progress feedback with a progress bar or status callbacks. Recommended for interactive scripts or notebooks.
client.finish():
with context manager to automatically call weave.finish() on exit:
weave.flush(). See Flushing for more information.
For additional resilience against data loss, consider enabling the write-ahead log, which writes trace data to disk before sending it to the server.
Trace Data Performance