Observability with Clickhouse
Configure your tracing data and store them in Clickhouse
Setting up
# Create langdb database if it doesn't exist
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS langdb"
# Import the traces table schema
clickhouse-client --query "$(cat sql/traces.sql)"ai-gateway serve --clickhouse-url "clickhouse://localhost:9000"clickhouse:
url: "http://localhost:8123"Querying Traces
-- Get recent traces
SELECT
trace_id,
operation_name,
start_time_us,
finish_time_us,
(finish_time_us - start_time_us) as duration_us
FROM langdb.traces
WHERE finish_date >= today() - 1
ORDER BY finish_time_us DESC
LIMIT 10;Leveraging LangDB APIs within ClickHouse
Running with Docker Compose
Was this helpful?