Skip to main content
Keep transactional sessions in SQLite while batching trace spans into a dedicated ClickHouse OLAP store. AgentOS registers both databases, so trace readback must select the tracing store with db_id=clickhouse-traces.
traces_to_clickhouse.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Run the example

Save the code above as traces_to_clickhouse.py, then run:
Full source: cookbook/05_agent_os/13_observability/traces_to_clickhouse.py