:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
#!/bin/bash
set -e
cp -r /idl/* /var/lib/clickhouse/format_schemas/
# Wait for ClickHouse to be ready to accept queries, then flush log tables to ensure
# system log tables (e.g., system.crash_log) are created. Use timeout to avoid hanging.
READY=false
for i in {1..30}; do
if clickhouse client --query "select 1" > /dev/null 2>&1; then
clickhouse client --query "system flush logs"
READY=true
break
fi
sleep 1
done
if [ "$READY" = false ]; then
echo "ClickHouse failed to become ready after 30 seconds" >&2
exit 1
fi