: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
feat(sdk): add SDK aliases and separate AI usage metrics (#93911)
Manoel Aranda Netob36fc48f32d3
diff --git a/posthog/tasks/test/__snapshots__/test_usage_report.ambr b/posthog/tasks/test/__snapshots__/test_usage_report.ambrindex 7d9d3614520e..15dc5fb5ae5b 100644--- a/posthog/tasks/test/__snapshots__/test_usage_report.ambr+++ b/posthog/tasks/test/__snapshots__/test_usage_report.ambr@@ -3,7 +3,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 00:00:00'AND timestamp < '2022-01-10 02:00:00'@@ -14,9 +14,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -24,9 +27,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -38,7 +43,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 02:00:00'AND timestamp < '2022-01-10 04:00:00'@@ -49,9 +54,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -59,9 +67,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -73,7 +83,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 20:00:00'AND timestamp < '2022-01-10 22:00:00'@@ -84,9 +94,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -94,9 +107,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -108,7 +123,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 22:00:00'AND timestamp < '2022-01-10 23:59:59'@@ -119,9 +134,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -129,9 +147,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -154,16 +174,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 00:00:00'AND timestamp < '2022-01-10 02:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -171,16 +197,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 02:00:00'AND timestamp < '2022-01-10 04:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -188,16 +220,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 04:00:00'AND timestamp < '2022-01-10 06:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -205,16 +243,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 06:00:00'AND timestamp < '2022-01-10 08:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -222,16 +266,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 08:00:00'AND timestamp < '2022-01-10 10:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -239,16 +289,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 10:00:00'AND timestamp < '2022-01-10 12:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -256,16 +312,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 12:00:00'AND timestamp < '2022-01-10 14:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -273,7 +335,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 04:00:00'AND timestamp < '2022-01-10 06:00:00'@@ -284,9 +346,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -294,9 +359,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -308,16 +375,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 14:00:00'AND timestamp < '2022-01-10 16:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -325,16 +398,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 16:00:00'AND timestamp < '2022-01-10 18:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -342,16 +421,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 18:00:00'AND timestamp < '2022-01-10 20:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -359,16 +444,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 20:00:00'AND timestamp < '2022-01-10 22:00:00'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -376,16 +467,22 @@'''SELECT team_id,+ replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') AS sdk_lib,replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') AS ai_lib,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 22:00:00'AND timestamp < '2022-01-10 23:59:59'- AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node')+ AND replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(JSONExtractRaw(properties, '$ai_lib'), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -471,7 +568,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 06:00:00'AND timestamp < '2022-01-10 08:00:00'@@ -482,9 +579,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -492,9 +592,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -632,7 +734,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 08:00:00'AND timestamp < '2022-01-10 10:00:00'@@ -643,9 +745,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -653,9 +758,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -799,7 +906,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 10:00:00'AND timestamp < '2022-01-10 12:00:00'@@ -810,9 +917,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -820,9 +930,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -991,7 +1103,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 12:00:00'AND timestamp < '2022-01-10 14:00:00'@@ -1002,9 +1114,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -1012,9 +1127,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -1224,7 +1341,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 14:00:00'AND timestamp < '2022-01-10 16:00:00'@@ -1235,9 +1352,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -1245,9 +1365,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -1456,7 +1578,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 16:00:00'AND timestamp < '2022-01-10 18:00:00'@@ -1467,9 +1589,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -1477,9 +1602,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -1609,7 +1736,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'web', 'web_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'js', 'web_lite_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node', 'node_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-node-mcp', 'node_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python-mcp', 'python_mcp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-edge', 'edge_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-convex', 'convex_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-android', 'android_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-kmp', 'kmp_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-flutter', 'flutter_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ios', 'ios_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-go', 'go_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-java', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-server', 'java_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-react-native', 'react_native_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-ruby', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rails', 'ruby_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-python', 'python_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-php', 'php_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-dotnet', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-aspnetcore', 'dotnet_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-elixir', 'elixir_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-unity', 'unity_events', replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events PREWHERE timestamp >= '2022-01-10 18:00:00'AND timestamp < '2022-01-10 20:00:00'@@ -1620,9 +1747,12 @@OR replaceRegexpAll(JSONExtractRaw(properties, '$lib'), '^"|"$', '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -1630,9 +1760,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))diff --git a/posthog/tasks/test/__snapshots__/test_usage_report.new_events_schema.ambr b/posthog/tasks/test/__snapshots__/test_usage_report.new_events_schema.ambrindex ac88b2ea6bec..c24d35efb9dd 100644--- a/posthog/tasks/test/__snapshots__/test_usage_report.new_events_schema.ambr+++ b/posthog/tasks/test/__snapshots__/test_usage_report.new_events_schema.ambr@@ -3,7 +3,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 20:00:00'AND timestamp < '2022-01-10 22:00:00'@@ -14,9 +14,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -24,9 +27,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -38,7 +43,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 22:00:00'AND timestamp < '2022-01-10 23:59:59'@@ -49,9 +54,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -59,9 +67,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -73,20 +83,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 00:00:00'AND timestamp < '2022-01-10 02:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -94,20 +110,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 02:00:00'AND timestamp < '2022-01-10 04:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -115,20 +137,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 04:00:00'AND timestamp < '2022-01-10 06:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -136,20 +164,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 06:00:00'AND timestamp < '2022-01-10 08:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -157,20 +191,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 08:00:00'AND timestamp < '2022-01-10 10:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -178,20 +218,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 10:00:00'AND timestamp < '2022-01-10 12:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -199,20 +245,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 12:00:00'AND timestamp < '2022-01-10 14:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -220,20 +272,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 14:00:00'AND timestamp < '2022-01-10 16:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -241,7 +299,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 02:00:00'AND timestamp < '2022-01-10 04:00:00'@@ -252,9 +310,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -262,9 +323,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -276,20 +339,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 16:00:00'AND timestamp < '2022-01-10 18:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -297,20 +366,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 18:00:00'AND timestamp < '2022-01-10 20:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -318,20 +393,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 20:00:00'AND timestamp < '2022-01-10 22:00:00'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -339,20 +420,26 @@'''SELECT team_id,+ ifNull(properties.`$lib`, '') AS sdk_lib,replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') AS ai_lib,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 22:00:00'AND timestamp < '2022-01-10 23:59:59'- AND ifNull(properties.`$lib`, '') IN ('posthog-node')+ AND ifNull(properties.`$lib`, '') IN ('posthog-node',+ 'posthog-python',+ 'posthog-dotnet',+ 'posthog-aspnetcore')AND startsWith(event, '$ai_')WHERE replaceRegexpAll(ifNull(if(toJSONString(properties.^`$ai_lib`) != '{}', toJSONString(properties.^`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'Array')OR startsWith(dynamicType(properties.`$ai_lib`), 'Map')OR startsWith(dynamicType(properties.`$ai_lib`), 'Tuple'), toJSONString(properties.`$ai_lib`), if(startsWith(dynamicType(properties.`$ai_lib`), 'DateTime'), replaceOne(toString(properties.`$ai_lib`), ' ', 'T'), toString(properties.`$ai_lib`)))), ''), '^"|"$', '') IN ('posthog-openclaw',+ 'posthog-opencode','@posthog/pi','posthog-ai')GROUP BY team_id,+ sdk_lib,ai_lib'''# ---@@ -434,7 +521,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 04:00:00'AND timestamp < '2022-01-10 06:00:00'@@ -445,9 +532,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -455,9 +545,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -595,7 +687,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 06:00:00'AND timestamp < '2022-01-10 08:00:00'@@ -606,9 +698,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -616,9 +711,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -772,7 +869,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 08:00:00'AND timestamp < '2022-01-10 10:00:00'@@ -783,9 +880,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -793,9 +893,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -916,7 +1018,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 10:00:00'AND timestamp < '2022-01-10 12:00:00'@@ -927,9 +1029,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -937,9 +1042,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -951,7 +1058,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 12:00:00'AND timestamp < '2022-01-10 14:00:00'@@ -962,9 +1069,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -972,9 +1082,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -986,7 +1098,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 14:00:00'AND timestamp < '2022-01-10 16:00:00'@@ -997,9 +1109,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -1007,9 +1122,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -1021,7 +1138,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 16:00:00'AND timestamp < '2022-01-10 18:00:00'@@ -1032,9 +1149,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -1042,9 +1162,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -1056,7 +1178,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 18:00:00'AND timestamp < '2022-01-10 20:00:00'@@ -1067,9 +1189,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -1077,9 +1202,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))@@ -1091,7 +1218,7 @@'''SELECT team_id,- multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,+ multiIf(event LIKE 'helicone%', 'helicone_events', event LIKE 'langfuse%', 'langfuse_events', event LIKE 'keywords_ai%', 'keywords_ai_events', event LIKE 'traceloop%', 'traceloop_events', ifNull(properties.`$lib`, '') = 'web', 'web_events', ifNull(properties.`$lib`, '') = 'js', 'web_lite_events', ifNull(properties.`$lib`, '') = 'posthog-node', 'node_events', ifNull(properties.`$lib`, '') = 'posthog-node-mcp', 'node_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-python-mcp', 'python_mcp_events', ifNull(properties.`$lib`, '') = 'posthog-edge', 'edge_events', ifNull(properties.`$lib`, '') = 'posthog-convex', 'convex_events', ifNull(properties.`$lib`, '') = 'posthog-android', 'android_events', ifNull(properties.`$lib`, '') = 'posthog-kmp', 'kmp_events', ifNull(properties.`$lib`, '') = 'posthog-flutter', 'flutter_events', ifNull(properties.`$lib`, '') = 'posthog-ios', 'ios_events', ifNull(properties.`$lib`, '') = 'posthog-go', 'go_events', ifNull(properties.`$lib`, '') = 'posthog-java', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-server', 'java_events', ifNull(properties.`$lib`, '') = 'posthog-react-native', 'react_native_events', ifNull(properties.`$lib`, '') = 'posthog-ruby', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-rails', 'ruby_events', ifNull(properties.`$lib`, '') = 'posthog-python', 'python_events', ifNull(properties.`$lib`, '') = 'posthog-php', 'php_events', ifNull(properties.`$lib`, '') = 'posthog-dotnet', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-aspnetcore', 'dotnet_events', ifNull(properties.`$lib`, '') = 'posthog-elixir', 'elixir_events', ifNull(properties.`$lib`, '') = 'posthog-unity', 'unity_events', ifNull(properties.`$lib`, '') = 'posthog-rs', 'rust_events', 'other') AS metric,count(1) as countFROM events_json PREWHERE timestamp >= '2022-01-10 00:00:00'AND timestamp < '2022-01-10 02:00:00'@@ -1102,9 +1229,12 @@OR ifNull(properties.`$lib`, '') IN ('web','js','posthog-node',+ 'posthog-node-mcp',+ 'posthog-python-mcp','posthog-edge','posthog-convex','posthog-android',+ 'posthog-kmp','posthog-flutter','posthog-ios','posthog-go',@@ -1112,9 +1242,11 @@'posthog-server','posthog-react-native','posthog-ruby',+ 'posthog-rails','posthog-python','posthog-php','posthog-dotnet',+ 'posthog-aspnetcore','posthog-elixir','posthog-unity','posthog-rs'))diff --git a/posthog/tasks/test/test_usage_report.py b/posthog/tasks/test/test_usage_report.pyindex 8d8163d971c0..c64b3d5ea189 100644--- a/posthog/tasks/test/test_usage_report.py+++ b/posthog/tasks/test/test_usage_report.py@@ -483,9 +483,12 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"web","js","posthog-node",+ "posthog-node-mcp",+ "posthog-python-mcp","posthog-edge","posthog-convex","posthog-android",+ "posthog-kmp","posthog-flutter","posthog-ios","posthog-go",@@ -493,9 +496,11 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"posthog-server","posthog-react-native","posthog-ruby",+ "posthog-rails","posthog-python","posthog-php","posthog-dotnet",+ "posthog-aspnetcore","posthog-elixir","posthog-unity",]@@ -518,6 +523,14 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesMtimestamp=now() - relativedelta(hours=12),team=self.org_1_team_1,)+ create_event(+ event_uuid=uuid4(),+ distinct_id=distinct_id,+ event="$ai_generation",+ properties={"$lib": "posthog-node", "$ai_lib": "posthog-opencode", "$is_identified": True},+ timestamp=now() - relativedelta(hours=12),+ team=self.org_1_team_1,+ )create_event(event_uuid=uuid4(),distinct_id=distinct_id,@@ -534,6 +547,22 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesMtimestamp=now() - relativedelta(hours=12),team=self.org_1_team_1,)+ create_event(+ event_uuid=uuid4(),+ distinct_id=distinct_id,+ event="$ai_generation",+ properties={"$lib": "posthog-python", "$ai_lib": "posthog-ai", "$is_identified": True},+ timestamp=now() - relativedelta(hours=12),+ team=self.org_1_team_1,+ )+ create_event(+ event_uuid=uuid4(),+ distinct_id=distinct_id,+ event="$ai_generation",+ properties={"$lib": "posthog-dotnet", "$ai_lib": "posthog-ai", "$is_identified": True},+ timestamp=now() - relativedelta(hours=12),+ team=self.org_1_team_1,+ )# Events for org 1 team 2distinct_id = str(uuid4())@@ -661,8 +690,8 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM},"plugins_enabled": {"Installed and enabled": 1},"instance_tag": "none",- "event_count_in_period": 44,- "enhanced_persons_event_count_in_period": 43,+ "event_count_in_period": 49,+ "enhanced_persons_event_count_in_period": 48,"event_count_with_groups_in_period": 2,"event_count_from_keywords_ai_in_period": 1,"event_count_from_traceloop_in_period": 1,@@ -671,6 +700,8 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"web_events_count_in_period": 37,"web_lite_events_count_in_period": 1,"node_events_count_in_period": 1,+ "node_mcp_events_count_in_period": 1,+ "python_mcp_events_count_in_period": 1,"mcp_tool_call_events_count_in_period": 0,"mcp_missing_capability_events_count_in_period": 0,"mcp_initialize_events_count_in_period": 0,@@ -680,20 +711,24 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"mcp_prompt_get_events_count_in_period": 0,"mcp_prompts_list_events_count_in_period": 0,"openclaw_events_count_in_period": 1,+ "opencode_events_count_in_period": 1,"posthog_pi_events_count_in_period": 1,"posthog_ai_events_count_in_period": 1,+ "posthog_python_ai_events_count_in_period": 1,+ "posthog_dotnet_ai_events_count_in_period": 1,"edge_events_count_in_period": 1,"convex_events_count_in_period": 1,"android_events_count_in_period": 1,+ "kmp_events_count_in_period": 1,"flutter_events_count_in_period": 1,"ios_events_count_in_period": 1,"go_events_count_in_period": 1,"java_events_count_in_period": 2,"react_native_events_count_in_period": 1,- "ruby_events_count_in_period": 1,+ "ruby_events_count_in_period": 2,"python_events_count_in_period": 1,"php_events_count_in_period": 1,- "dotnet_events_count_in_period": 1,+ "dotnet_events_count_in_period": 2,"elixir_events_count_in_period": 1,"unity_events_count_in_period": 1,"rust_events_count_in_period": 0,@@ -736,7 +771,7 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"event_explorer_api_duration_ms": 0,"rows_synced_in_period": 0,"exceptions_captured_in_period": 0,- "ai_event_count_in_period": 4,+ "ai_event_count_in_period": 7,"hog_function_calls_in_period": 0,"hog_function_fetch_calls_in_period": 0,"cdp_billable_invocations_in_period": 0,@@ -749,8 +784,8 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"team_count": 2,"teams": {str(self.org_1_team_1.id): {- "event_count_in_period": 33,- "enhanced_persons_event_count_in_period": 32,+ "event_count_in_period": 38,+ "enhanced_persons_event_count_in_period": 37,"event_count_with_groups_in_period": 2,"event_count_from_keywords_ai_in_period": 1,"event_count_from_traceloop_in_period": 1,@@ -759,6 +794,8 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"web_events_count_in_period": 25,"web_lite_events_count_in_period": 1,"node_events_count_in_period": 1,+ "node_mcp_events_count_in_period": 1,+ "python_mcp_events_count_in_period": 1,"mcp_tool_call_events_count_in_period": 0,"mcp_missing_capability_events_count_in_period": 0,"mcp_initialize_events_count_in_period": 0,@@ -768,20 +805,24 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"mcp_prompt_get_events_count_in_period": 0,"mcp_prompts_list_events_count_in_period": 0,"openclaw_events_count_in_period": 1,+ "opencode_events_count_in_period": 1,"posthog_pi_events_count_in_period": 1,"posthog_ai_events_count_in_period": 1,+ "posthog_python_ai_events_count_in_period": 1,+ "posthog_dotnet_ai_events_count_in_period": 1,"edge_events_count_in_period": 1,"convex_events_count_in_period": 1,"android_events_count_in_period": 1,+ "kmp_events_count_in_period": 1,"flutter_events_count_in_period": 1,"ios_events_count_in_period": 1,"go_events_count_in_period": 1,"java_events_count_in_period": 2,"react_native_events_count_in_period": 1,- "ruby_events_count_in_period": 1,+ "ruby_events_count_in_period": 2,"python_events_count_in_period": 1,"php_events_count_in_period": 1,- "dotnet_events_count_in_period": 1,+ "dotnet_events_count_in_period": 2,"elixir_events_count_in_period": 1,"unity_events_count_in_period": 1,"rust_events_count_in_period": 0,@@ -828,7 +869,7 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"hog_function_fetch_calls_in_period": 0,"cdp_billable_invocations_in_period": 0,"rows_exported_in_period": 0,- "ai_event_count_in_period": 4,+ "ai_event_count_in_period": 7,},str(self.org_1_team_2.id): {"event_count_in_period": 11,@@ -841,6 +882,8 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"web_events_count_in_period": 12,"web_lite_events_count_in_period": 0,"node_events_count_in_period": 0,+ "node_mcp_events_count_in_period": 0,+ "python_mcp_events_count_in_period": 0,"mcp_tool_call_events_count_in_period": 0,"mcp_missing_capability_events_count_in_period": 0,"mcp_initialize_events_count_in_period": 0,@@ -850,11 +893,15 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"mcp_prompt_get_events_count_in_period": 0,"mcp_prompts_list_events_count_in_period": 0,"openclaw_events_count_in_period": 0,+ "opencode_events_count_in_period": 0,"posthog_pi_events_count_in_period": 0,"posthog_ai_events_count_in_period": 0,+ "posthog_python_ai_events_count_in_period": 0,+ "posthog_dotnet_ai_events_count_in_period": 0,"edge_events_count_in_period": 0,"convex_events_count_in_period": 0,"android_events_count_in_period": 0,+ "kmp_events_count_in_period": 0,"flutter_events_count_in_period": 0,"ios_events_count_in_period": 0,"go_events_count_in_period": 0,@@ -946,6 +993,8 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"web_events_count_in_period": 11,"web_lite_events_count_in_period": 0,"node_events_count_in_period": 0,+ "node_mcp_events_count_in_period": 0,+ "python_mcp_events_count_in_period": 0,"mcp_tool_call_events_count_in_period": 0,"mcp_missing_capability_events_count_in_period": 0,"mcp_initialize_events_count_in_period": 0,@@ -955,11 +1004,15 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"mcp_prompt_get_events_count_in_period": 0,"mcp_prompts_list_events_count_in_period": 0,"openclaw_events_count_in_period": 0,+ "opencode_events_count_in_period": 0,"posthog_pi_events_count_in_period": 0,"posthog_ai_events_count_in_period": 0,+ "posthog_python_ai_events_count_in_period": 0,+ "posthog_dotnet_ai_events_count_in_period": 0,"edge_events_count_in_period": 0,"convex_events_count_in_period": 0,"android_events_count_in_period": 0,+ "kmp_events_count_in_period": 0,"flutter_events_count_in_period": 0,"ios_events_count_in_period": 0,"go_events_count_in_period": 0,@@ -1034,6 +1087,8 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"web_events_count_in_period": 11,"web_lite_events_count_in_period": 0,"node_events_count_in_period": 0,+ "node_mcp_events_count_in_period": 0,+ "python_mcp_events_count_in_period": 0,"mcp_tool_call_events_count_in_period": 0,"mcp_missing_capability_events_count_in_period": 0,"mcp_initialize_events_count_in_period": 0,@@ -1043,11 +1098,15 @@ class TestUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesM"mcp_prompt_get_events_count_in_period": 0,"mcp_prompts_list_events_count_in_period": 0,"openclaw_events_count_in_period": 0,+ "opencode_events_count_in_period": 0,"posthog_pi_events_count_in_period": 0,"posthog_ai_events_count_in_period": 0,+ "posthog_python_ai_events_count_in_period": 0,+ "posthog_dotnet_ai_events_count_in_period": 0,"edge_events_count_in_period": 0,"convex_events_count_in_period": 0,"android_events_count_in_period": 0,+ "kmp_events_count_in_period": 0,"flutter_events_count_in_period": 0,"ios_events_count_in_period": 0,"go_events_count_in_period": 0,@@ -1566,11 +1625,32 @@ class TestQueryUsageReportSQL:_mock_use_new_events_schema: MagicMock,) -> None:mock_get_property_string_expr.side_effect = [("lib_expr", True), ("ai_lib_expr", True)]- # 1st _execute_split_query call is the main per-$lib scan (node_events over-counts every- # posthog-node event); 2nd is the AI sub-SDK rows (team_id, $ai_lib, count) over $ai_* events.+ # 1st _execute_split_query call is the main per-$lib scan; 2nd is the AI sub-SDK rows+ # (team_id, $lib, $ai_lib, count) used to remove sub-SDK events from each parent metric.mock_execute_split_query.side_effect = [- {"node_events": [(1, 10)], "openclaw_events": [], "posthog_pi_events": [], "posthog_ai_events": []},- [(1, "posthog-ai", 2), (1, "posthog-openclaw", 3)],+ {+ "node_events": [(1, 10)],+ "python_events": [(1, 7)],+ "node_mcp_events": [(1, 9)],+ "python_mcp_events": [(1, 6)],+ "kmp_events": [(1, 8)],+ "ruby_events": [(1, 2)],+ "dotnet_events": [(1, 5)],+ "openclaw_events": [],+ "opencode_events": [],+ "posthog_pi_events": [],+ "posthog_ai_events": [],+ "posthog_python_ai_events": [],+ "posthog_dotnet_ai_events": [],+ },+ [+ (1, "posthog-node", "posthog-ai", 2),+ (1, "posthog-node", "posthog-openclaw", 3),+ (1, "posthog-node", "posthog-opencode", 1),+ (1, "posthog-python", "posthog-ai", 4),+ (1, "posthog-dotnet", "posthog-ai", 1),+ (1, "posthog-aspnetcore", "posthog-ai", 2),+ ],]# Both MCP scans are calendar-aligned, so they reach sync_execute directly: 1st is# `$mcp_tool_call`, 2nd is the grouped (team_id, event, count) scan over the other 7 events.@@ -1592,17 +1672,25 @@ class TestQueryUsageReportSQL:assert "OR lib_expr IN (" in main_queryassert "event = '$mcp_tool_call'" not in main_queryassert "'posthog-node'" in main_query+ assert "'posthog-node-mcp'" in main_query+ assert "'posthog-python-mcp'" in main_query+ assert "'posthog-kmp'" in main_query+ assert "'posthog-rails'" in main_query+ assert "'posthog-aspnetcore'" in main_queryassert "'posthog-rs'" in main_queryassert "ai_lib_expr" not in main_queryassert "HAVING metric != 'other'" not in main_queryassert mock_execute_split_query.call_args_list[0].kwargs["num_splits"] == 12- # AI sub-SDK scan reads $ai_lib only for the $ai_* subset.+ # AI sub-SDK scan reads both library identities only for the $ai_* subset.ai_query = mock_execute_split_query.call_args_list[1].kwargs["query_template"]assert "startsWith(event, '$ai_')" in ai_query- assert "lib_expr IN ('posthog-node')" in ai_query+ assert "lib_expr AS sdk_lib" in ai_query+ assert "lib_expr IN ('posthog-node', 'posthog-python', 'posthog-dotnet', 'posthog-aspnetcore')" in ai_queryassert "ai_lib_expr IN (" in ai_query+ assert "GROUP BY team_id, sdk_lib, ai_lib" in ai_queryassert "'posthog-ai'" in ai_query+ assert "'posthog-opencode'" in ai_querydedup_expression = "uniqExact(tuple(toDate(timestamp), cityHash64(distinct_id), cityHash64(uuid)))"@@ -1623,10 +1711,19 @@ class TestQueryUsageReportSQL:# One grouped query for the 7, not one query each.assert mock_sync_execute.call_count == 2- # AI counts are folded back in and subtracted from node_events (10 - 2 - 3 = 5).+ # Subtract AI sub-SDK counts so each event belongs to one SDK metric.assert result["posthog_ai_events"] == [(1, 2)]+ assert result["posthog_python_ai_events"] == [(1, 4)]+ assert result["posthog_dotnet_ai_events"] == [(1, 3)]assert result["openclaw_events"] == [(1, 3)]- assert result["node_events"] == [(1, 5)]+ assert result["opencode_events"] == [(1, 1)]+ assert result["node_events"] == [(1, 4)]+ assert result["python_events"] == [(1, 3)]+ assert result["node_mcp_events"] == [(1, 9)]+ assert result["python_mcp_events"] == [(1, 6)]+ assert result["kmp_events"] == [(1, 8)]+ assert result["ruby_events"] == [(1, 2)]+ assert result["dotnet_events"] == [(1, 2)]# New MCP Analytics metrics are merged straight into the returned dict.assert result["mcp_missing_capability_events"] == [(1, 6)]@@ -5913,7 +6010,7 @@ class TestQuerySplitting(ClickhouseDestroyTablesMixin, ClickhouseTestMixin, Testdistinct_id="mcp_user",event_uuid=tool_call_event_uuid,timestamp=self.begin + relativedelta(hours=1),- properties={"$lib": "custom-mcp-client"},+ properties={"$lib": "posthog-node-mcp"},)_create_event(event="$mcp_tool_call",@@ -5928,7 +6025,7 @@ class TestQuerySplitting(ClickhouseDestroyTablesMixin, ClickhouseTestMixin, Testteam=self.team,distinct_id="python_mcp_user",timestamp=self.begin + relativedelta(hours=3),- properties={"$lib": "posthog-python"},+ properties={"$lib": "posthog-python-mcp"},)flush_persons_and_events()@@ -5939,8 +6036,10 @@ class TestQuerySplitting(ClickhouseDestroyTablesMixin, ClickhouseTestMixin, Testevent_metrics = get_all_event_metrics_in_period(self.begin, reporting_end)self.assertEqual(billable_result_after, [(self.team.id, baseline_count + 3)])+ self.assertEqual(dict(event_metrics["node_mcp_events"]).get(self.team.id), 2)self.assertEqual(dict(event_metrics["mcp_tool_call_events"]).get(self.team.id), 2)- self.assertEqual(dict(event_metrics["python_events"]).get(self.team.id), 1)+ self.assertEqual(dict(event_metrics["python_mcp_events"]).get(self.team.id), 1)+ self.assertIsNone(dict(event_metrics["python_events"]).get(self.team.id))@parameterized.expand([@@ -5991,6 +6090,41 @@ class TestQuerySplitting(ClickhouseDestroyTablesMixin, ClickhouseTestMixin, Testtimestamp=self.begin + relativedelta(hours=12),properties={"$lib": "posthog-node"},)+ _create_event(+ event="$pageview",+ team=self.team,+ distinct_id="python_user",+ timestamp=self.begin + relativedelta(hours=12),+ properties={"$lib": "posthog-python"},+ )+ _create_event(+ event="$ai_generation",+ team=self.team,+ distinct_id="python_ai_user",+ timestamp=self.begin + relativedelta(hours=12),+ properties={"$lib": "posthog-python", "$ai_lib": "posthog-ai"},+ )+ _create_event(+ event="$pageview",+ team=self.team,+ distinct_id="dotnet_user",+ timestamp=self.begin + relativedelta(hours=12),+ properties={"$lib": "posthog-dotnet"},+ )+ _create_event(+ event="$ai_generation",+ team=self.team,+ distinct_id="dotnet_ai_user",+ timestamp=self.begin + relativedelta(hours=12),+ properties={"$lib": "posthog-dotnet", "$ai_lib": "posthog-ai"},+ )+ _create_event(+ event="$ai_generation",+ team=self.team,+ distinct_id="aspnetcore_ai_user",+ timestamp=self.begin + relativedelta(hours=12),+ properties={"$lib": "posthog-aspnetcore", "$ai_lib": "posthog-ai"},+ )_create_event(event="$ai_generation",team=self.team,@@ -5998,6 +6132,13 @@ class TestQuerySplitting(ClickhouseDestroyTablesMixin, ClickhouseTestMixin, Testtimestamp=self.begin + relativedelta(hours=12),properties={"$lib": "posthog-node", "$ai_lib": "posthog-openclaw"},)+ _create_event(+ event="$ai_generation",+ team=self.team,+ distinct_id="opencode_user",+ timestamp=self.begin + relativedelta(hours=12),+ properties={"$lib": "posthog-node", "$ai_lib": "posthog-opencode"},+ )_create_event(event="$ai_span",team=self.team,@@ -6018,8 +6159,13 @@ class TestQuerySplitting(ClickhouseDestroyTablesMixin, ClickhouseTestMixin, Testself.assertEqual(dict(result["node_events"]).get(self.team.id), 1)self.assertEqual(dict(result["openclaw_events"]).get(self.team.id), 1)+ self.assertEqual(dict(result["opencode_events"]).get(self.team.id), 1)self.assertEqual(dict(result["posthog_pi_events"]).get(self.team.id), 1)self.assertEqual(dict(result["posthog_ai_events"]).get(self.team.id), 1)+ self.assertEqual(dict(result["python_events"]).get(self.team.id), 1)+ self.assertEqual(dict(result["posthog_python_ai_events"]).get(self.team.id), 1)+ self.assertEqual(dict(result["dotnet_events"]).get(self.team.id), 1)+ self.assertEqual(dict(result["posthog_dotnet_ai_events"]).get(self.team.id), 2)@patch("posthog.tasks.usage_report._execute_split_query")def test_split_query_with_different_num_splits(self, mock_execute_split_query: MagicMock) -> None:diff --git a/posthog/tasks/usage_report.py b/posthog/tasks/usage_report.pyindex 9a1f4243293b..2e539b982f92 100644--- a/posthog/tasks/usage_report.py+++ b/posthog/tasks/usage_report.py@@ -31,6 +31,7 @@ from posthog.clickhouse.client.connection import ClickHouseUser, Workloadfrom posthog.clickhouse.query_tagging import Feature, Product, tags_contextfrom posthog.cloud_utils import get_cached_instance_licensefrom posthog.constants import FlagRequestType+from posthog.dataclasses import frozenfrom posthog.exceptions_capture import capture_exceptionfrom posthog.logging.timing import timed_logfrom posthog.models import OrganizationMembership, User@@ -306,6 +307,8 @@ class UsageReportCounters:web_events_count_in_period: intweb_lite_events_count_in_period: intnode_events_count_in_period: int+ node_mcp_events_count_in_period: int+ python_mcp_events_count_in_period: int# MCP usage overlaps billable event and per-SDK totals.mcp_tool_call_events_count_in_period: int@@ -319,11 +322,15 @@ class UsageReportCounters:# SDK usage (continued)openclaw_events_count_in_period: int+ opencode_events_count_in_period: intposthog_pi_events_count_in_period: intposthog_ai_events_count_in_period: int+ posthog_python_ai_events_count_in_period: int+ posthog_dotnet_ai_events_count_in_period: intedge_events_count_in_period: intconvex_events_count_in_period: intandroid_events_count_in_period: int+ kmp_events_count_in_period: intflutter_events_count_in_period: intios_events_count_in_period: intgo_events_count_in_period: int@@ -789,6 +796,12 @@ def get_teams_with_event_count_with_groups_in_period(begin: datetime, end: datet)+@frozen+class _AISubSDKEventMetricCounts:+ counts_by_metric: dict[str, list[tuple[int, int]]]+ parent_subtractions: dict[str, dict[int, int]]++def _get_ai_sub_sdk_event_metric_counts(begin: datetime,end: datetime,@@ -796,25 +809,30 @@ def _get_ai_sub_sdk_event_metric_counts(lib_expression: str,ai_lib_expression: str,use_new_events_schema: bool,-) -> tuple[dict[str, list[tuple[int, int]]], dict[int, int]]:- ai_lib_to_metric: dict[str, str] = {}+) -> _AISubSDKEventMetricCounts:+ ai_sdk_to_metric: dict[tuple[str, str], str] = {}+ parent_metric_by_lib = {lib: sdk_metric for lib, ai_lib, sdk_metric in sdk_metrics if ai_lib is None}ai_parent_libs: list[str] = []+ ai_libs: list[str] = []for lib, ai_lib, sdk_metric in sdk_metrics:if ai_lib is None:continue- ai_lib_to_metric[ai_lib] = sdk_metric+ ai_sdk_to_metric[(lib, ai_lib)] = sdk_metricif lib not in ai_parent_libs:ai_parent_libs.append(lib)+ if ai_lib not in ai_libs:+ ai_libs.append(ai_lib)- if not ai_lib_to_metric:- return {}, {}+ if not ai_sdk_to_metric:+ return _AISubSDKEventMetricCounts(counts_by_metric={}, parent_subtractions={})quoted_ai_parent_libs = ", ".join(f"'{lib}'" for lib in ai_parent_libs)- quoted_ai_libs = ", ".join(f"'{ai_lib}'" for ai_lib in ai_lib_to_metric)+ quoted_ai_libs = ", ".join(f"'{ai_lib}'" for ai_lib in ai_libs)# nosemgrep: clickhouse-fstring-param-audit - SDK property expressions come from internal helpersquery_template = f"""SELECTteam_id,+ {lib_expression} AS sdk_lib,{ai_lib_expression} AS ai_lib,count(1) as countFROM {events_read_table(use_new_events_schema)}@@ -822,7 +840,7 @@ def _get_ai_sub_sdk_event_metric_counts(AND {lib_expression} IN ({quoted_ai_parent_libs})AND startsWith(event, '$ai_')WHERE {ai_lib_expression} IN ({quoted_ai_libs})- GROUP BY team_id, ai_lib+ GROUP BY team_id, sdk_lib, ai_lib"""ai_rows = _execute_split_query(@@ -834,19 +852,24 @@ def _get_ai_sub_sdk_event_metric_counts(combine_results_func=_flatten_split_query_results,)- ai_counts_by_metric: dict[str, dict[int, int]] = {metric_name: {} for metric_name in ai_lib_to_metric.values()}- node_subtractions: dict[int, int] = {}- for team_id, ai_lib, count in ai_rows:- metric_name = ai_lib_to_metric.get(ai_lib)- if metric_name is None:+ ai_counts_by_metric: dict[str, dict[int, int]] = {metric_name: {} for metric_name in ai_sdk_to_metric.values()}+ parent_subtractions: dict[str, dict[int, int]] = {}+ for team_id, sdk_lib, ai_lib, count in ai_rows:+ metric_name = ai_sdk_to_metric.get((sdk_lib, ai_lib))+ parent_metric_name = parent_metric_by_lib.get(sdk_lib)+ if metric_name is None or parent_metric_name is None:continueteam_counts = ai_counts_by_metric[metric_name]team_counts[team_id] = team_counts.get(team_id, 0) + count- node_subtractions[team_id] = node_subtractions.get(team_id, 0) + count+ parent_team_counts = parent_subtractions.setdefault(parent_metric_name, {})+ parent_team_counts[team_id] = parent_team_counts.get(team_id, 0) + count- return {- metric_name: list(team_counts.items()) for metric_name, team_counts in ai_counts_by_metric.items()- }, node_subtractions+ return _AISubSDKEventMetricCounts(+ counts_by_metric={+ metric_name: list(team_counts.items()) for metric_name, team_counts in ai_counts_by_metric.items()+ },+ parent_subtractions=parent_subtractions,+ )# MCP Analytics events emitted verbatim by the @posthog/mcp SDK, beyond `$mcp_tool_call` (which@@ -935,12 +958,16 @@ def get_all_event_metrics_in_period(begin: datetime, end: datetime) -> dict[str,("web", None, "web_events"),("js", None, "web_lite_events"),("posthog-node", "posthog-openclaw", "openclaw_events"),+ ("posthog-node", "posthog-opencode", "opencode_events"),("posthog-node", "@posthog/pi", "posthog_pi_events"),("posthog-node", "posthog-ai", "posthog_ai_events"),("posthog-node", None, "node_events"),+ ("posthog-node-mcp", None, "node_mcp_events"),+ ("posthog-python-mcp", None, "python_mcp_events"),("posthog-edge", None, "edge_events"),("posthog-convex", None, "convex_events"),("posthog-android", None, "android_events"),+ ("posthog-kmp", None, "kmp_events"),("posthog-flutter", None, "flutter_events"),("posthog-ios", None, "ios_events"),("posthog-go", None, "go_events"),@@ -948,9 +975,14 @@ def get_all_event_metrics_in_period(begin: datetime, end: datetime) -> dict[str,("posthog-server", None, "java_events"),("posthog-react-native", None, "react_native_events"),("posthog-ruby", None, "ruby_events"),+ ("posthog-rails", None, "ruby_events"),+ ("posthog-python", "posthog-ai", "posthog_python_ai_events"),("posthog-python", None, "python_events"),("posthog-php", None, "php_events"),+ ("posthog-dotnet", "posthog-ai", "posthog_dotnet_ai_events"),+ ("posthog-aspnetcore", "posthog-ai", "posthog_dotnet_ai_events"),("posthog-dotnet", None, "dotnet_events"),+ ("posthog-aspnetcore", None, "dotnet_events"),("posthog-elixir", None, "elixir_events"),("posthog-unity", None, "unity_events"),("posthog-rs", None, "rust_events"),@@ -999,12 +1031,18 @@ def get_all_event_metrics_in_period(begin: datetime, end: datetime) -> dict[str,"web_events": {},"web_lite_events": {},"node_events": {},+ "node_mcp_events": {},+ "python_mcp_events": {},"openclaw_events": {},+ "opencode_events": {},"posthog_pi_events": {},"posthog_ai_events": {},+ "posthog_python_ai_events": {},+ "posthog_dotnet_ai_events": {},"edge_events": {},"convex_events": {},"android_events": {},+ "kmp_events": {},"flutter_events": {},"ios_events": {},"go_events": {},@@ -1059,7 +1097,7 @@ def get_all_event_metrics_in_period(begin: datetime, end: datetime) -> dict[str,params={},num_splits=12,)- ai_counts_by_metric, node_subtractions = _get_ai_sub_sdk_event_metric_counts(+ ai_sub_sdk_metric_counts = _get_ai_sub_sdk_event_metric_counts(begin=begin,end=end,sdk_metrics=sdk_metrics,@@ -1069,12 +1107,12 @@ def get_all_event_metrics_in_period(begin: datetime, end: datetime) -> dict[str,)mcp_analytics_counts_by_metric = _get_mcp_analytics_event_metric_counts(begin=begin, end=end)- # Fold the AI sub-counts in and remove them from node_events (the main scan counts every- # posthog-node event as node_events). max(0, count) guards against tiny cross-query ingestion jitter.- metrics["node_events"] = [- (team_id, max(0, count - node_subtractions.get(team_id, 0))) for team_id, count in metrics["node_events"]- ]- metrics.update(ai_counts_by_metric)+ # Remove sub-SDK events from each parent metric. max(0, count) guards against cross-query ingestion jitter.+ for parent_metric, team_subtractions in ai_sub_sdk_metric_counts.parent_subtractions.items():+ metrics[parent_metric] = [+ (team_id, max(0, count - team_subtractions.get(team_id, 0))) for team_id, count in metrics[parent_metric]+ ]+ metrics.update(ai_sub_sdk_metric_counts.counts_by_metric)metrics.update(mcp_analytics_counts_by_metric)return metrics@@ -2895,6 +2933,8 @@ def _get_all_usage_data(period_start: datetime, period_end: datetime) -> dict[st"teams_with_web_events_count_in_period": all_metrics["web_events"],"teams_with_web_lite_events_count_in_period": all_metrics["web_lite_events"],"teams_with_node_events_count_in_period": all_metrics["node_events"],+ "teams_with_node_mcp_events_count_in_period": all_metrics["node_mcp_events"],+ "teams_with_python_mcp_events_count_in_period": all_metrics["python_mcp_events"],"teams_with_mcp_tool_call_events_count_in_period": all_metrics["mcp_tool_call_events"],"teams_with_mcp_missing_capability_events_count_in_period": all_metrics["mcp_missing_capability_events"],"teams_with_mcp_initialize_events_count_in_period": all_metrics["mcp_initialize_events"],@@ -2904,11 +2944,15 @@ def _get_all_usage_data(period_start: datetime, period_end: datetime) -> dict[st"teams_with_mcp_prompt_get_events_count_in_period": all_metrics["mcp_prompt_get_events"],"teams_with_mcp_prompts_list_events_count_in_period": all_metrics["mcp_prompts_list_events"],"teams_with_openclaw_events_count_in_period": all_metrics["openclaw_events"],+ "teams_with_opencode_events_count_in_period": all_metrics["opencode_events"],"teams_with_posthog_pi_events_count_in_period": all_metrics["posthog_pi_events"],"teams_with_posthog_ai_events_count_in_period": all_metrics["posthog_ai_events"],+ "teams_with_posthog_python_ai_events_count_in_period": all_metrics["posthog_python_ai_events"],+ "teams_with_posthog_dotnet_ai_events_count_in_period": all_metrics["posthog_dotnet_ai_events"],"teams_with_edge_events_count_in_period": all_metrics["edge_events"],"teams_with_convex_events_count_in_period": all_metrics["convex_events"],"teams_with_android_events_count_in_period": all_metrics["android_events"],+ "teams_with_kmp_events_count_in_period": all_metrics["kmp_events"],"teams_with_flutter_events_count_in_period": all_metrics["flutter_events"],"teams_with_ios_events_count_in_period": all_metrics["ios_events"],"teams_with_go_events_count_in_period": all_metrics["go_events"],@@ -3295,6 +3339,8 @@ def _get_team_report(all_data: dict[str, Any], team: Team) -> UsageReportCounterweb_events_count_in_period=all_data["teams_with_web_events_count_in_period"].get(team.id, 0),web_lite_events_count_in_period=all_data["teams_with_web_lite_events_count_in_period"].get(team.id, 0),node_events_count_in_period=all_data["teams_with_node_events_count_in_period"].get(team.id, 0),+ node_mcp_events_count_in_period=all_data["teams_with_node_mcp_events_count_in_period"].get(team.id, 0),+ python_mcp_events_count_in_period=all_data["teams_with_python_mcp_events_count_in_period"].get(team.id, 0),mcp_tool_call_events_count_in_period=all_data["teams_with_mcp_tool_call_events_count_in_period"].get(team.id, 0),@@ -3320,11 +3366,19 @@ def _get_team_report(all_data: dict[str, Any], team: Team) -> UsageReportCounterteam.id, 0),openclaw_events_count_in_period=all_data["teams_with_openclaw_events_count_in_period"].get(team.id, 0),+ opencode_events_count_in_period=all_data["teams_with_opencode_events_count_in_period"].get(team.id, 0),posthog_pi_events_count_in_period=all_data["teams_with_posthog_pi_events_count_in_period"].get(team.id, 0),posthog_ai_events_count_in_period=all_data["teams_with_posthog_ai_events_count_in_period"].get(team.id, 0),+ posthog_python_ai_events_count_in_period=all_data["teams_with_posthog_python_ai_events_count_in_period"].get(+ team.id, 0+ ),+ posthog_dotnet_ai_events_count_in_period=all_data["teams_with_posthog_dotnet_ai_events_count_in_period"].get(+ team.id, 0+ ),edge_events_count_in_period=all_data["teams_with_edge_events_count_in_period"].get(team.id, 0),convex_events_count_in_period=all_data["teams_with_convex_events_count_in_period"].get(team.id, 0),android_events_count_in_period=all_data["teams_with_android_events_count_in_period"].get(team.id, 0),+ kmp_events_count_in_period=all_data["teams_with_kmp_events_count_in_period"].get(team.id, 0),flutter_events_count_in_period=all_data["teams_with_flutter_events_count_in_period"].get(team.id, 0),ios_events_count_in_period=all_data["teams_with_ios_events_count_in_period"].get(team.id, 0),go_events_count_in_period=all_data["teams_with_go_events_count_in_period"].get(team.id, 0),diff --git a/posthog/temporal/usage_report/queries.py b/posthog/temporal/usage_report/queries.pyindex b7bada2e7447..43fd1dbb8ceb 100644--- a/posthog/temporal/usage_report/queries.py+++ b/posthog/temporal/usage_report/queries.py@@ -279,6 +279,8 @@ QUERIES: list[QuerySpec] = ["web_events": "teams_with_web_events_count_in_period","web_lite_events": "teams_with_web_lite_events_count_in_period","node_events": "teams_with_node_events_count_in_period",+ "node_mcp_events": "teams_with_node_mcp_events_count_in_period",+ "python_mcp_events": "teams_with_python_mcp_events_count_in_period","mcp_tool_call_events": "teams_with_mcp_tool_call_events_count_in_period","mcp_missing_capability_events": "teams_with_mcp_missing_capability_events_count_in_period","mcp_initialize_events": "teams_with_mcp_initialize_events_count_in_period",@@ -288,11 +290,15 @@ QUERIES: list[QuerySpec] = ["mcp_prompt_get_events": "teams_with_mcp_prompt_get_events_count_in_period","mcp_prompts_list_events": "teams_with_mcp_prompts_list_events_count_in_period","openclaw_events": "teams_with_openclaw_events_count_in_period",+ "opencode_events": "teams_with_opencode_events_count_in_period","posthog_pi_events": "teams_with_posthog_pi_events_count_in_period","posthog_ai_events": "teams_with_posthog_ai_events_count_in_period",+ "posthog_python_ai_events": "teams_with_posthog_python_ai_events_count_in_period",+ "posthog_dotnet_ai_events": "teams_with_posthog_dotnet_ai_events_count_in_period","edge_events": "teams_with_edge_events_count_in_period","convex_events": "teams_with_convex_events_count_in_period","android_events": "teams_with_android_events_count_in_period",+ "kmp_events": "teams_with_kmp_events_count_in_period","flutter_events": "teams_with_flutter_events_count_in_period","ios_events": "teams_with_ios_events_count_in_period","go_events": "teams_with_go_events_count_in_period",diff --git a/posthog/test/test_feature_flag_analytics.py b/posthog/test/test_feature_flag_analytics.pyindex 0a93462b94d4..37c6aaca18f9 100644--- a/posthog/test/test_feature_flag_analytics.py+++ b/posthog/test/test_feature_flag_analytics.py@@ -640,23 +640,32 @@ class TestSdkBreakdown(BaseTest):rust/feature-flags/src/handler/types.rsIf this test fails after adding a new SDK to Rust, update SDK_LIBRARIES- in posthog/models/feature_flag/flag_analytics.py to match.+ in products/feature_flags/backend/flag_analytics.py to match."""expected_libraries = ["posthog-js","posthog-node",+ "posthog-node-mcp",+ "posthog-edge",+ "posthog-convex","posthog-python",+ "posthog-python-mcp","posthog-php","posthog-ruby",+ "posthog-rails","posthog-go","posthog-java","posthog-dotnet",+ "posthog-aspnetcore","posthog-elixir","posthog-rs","posthog-android","posthog-ios","posthog-react-native","posthog-flutter",+ "posthog-kmp",+ "posthog-unity",+ "posthog-server","other",]self.assertEqual(SDK_LIBRARIES, expected_libraries)diff --git a/products/feature_flags/backend/flag_analytics.py b/products/feature_flags/backend/flag_analytics.pyindex 0efe895c22ee..7045c50b1a45 100644--- a/products/feature_flags/backend/flag_analytics.py+++ b/products/feature_flags/backend/flag_analytics.py@@ -28,18 +28,27 @@ CACHE_BUCKET_SIZE = 60 * 2 # duration in secondsSDK_LIBRARIES = ["posthog-js","posthog-node",+ "posthog-node-mcp",+ "posthog-edge",+ "posthog-convex","posthog-python",+ "posthog-python-mcp","posthog-php","posthog-ruby",+ "posthog-rails","posthog-go","posthog-java","posthog-dotnet",+ "posthog-aspnetcore","posthog-elixir","posthog-rs","posthog-android","posthog-ios","posthog-react-native","posthog-flutter",+ "posthog-kmp",+ "posthog-unity",+ "posthog-server","other",]diff --git a/rust/feature-flags/src/handler/decoding.rs b/rust/feature-flags/src/handler/decoding.rsindex 271904619285..3e134d7d8ad3 100644--- a/rust/feature-flags/src/handler/decoding.rs+++ b/rust/feature-flags/src/handler/decoding.rs@@ -567,16 +567,25 @@ mod tests {#[case(Some("posthog-ios/3.0.0"), "posthog-ios")]#[case(Some("posthog-react-native/2.5.0"), "posthog-react-native")]#[case(Some("posthog-flutter/4.0.0"), "posthog-flutter")]+ #[case(Some("posthog-kmp/0.6.0"), "posthog-kmp")]+ #[case(Some("posthog-unity/4.5.0"), "posthog-unity")]#[case(Some("posthog-python/1.4.0"), "posthog-python")]+ #[case(Some("posthog-python-mcp/0.1.0"), "posthog-python-mcp")]#[case(Some("posthog-ruby/2.0.0"), "posthog-ruby")]+ #[case(Some("posthog-rails/3.18.0"), "posthog-rails")]#[case(Some("posthog-ruby2.0.0"), "posthog-ruby")]#[case(Some("posthog-php/3.0.0"), "posthog-php")]#[case(Some("posthog-java/1.0.0"), "posthog-java")]#[case(Some("posthog-go/0.1.0"), "posthog-go")]#[case(Some("posthog-node/2.2.0"), "posthog-node")]+ #[case(Some("posthog-node-mcp/0.7.0"), "posthog-node-mcp")]+ #[case(Some("posthog-edge/2.2.0"), "posthog-edge")]+ #[case(Some("posthog-convex/0.2.0"), "posthog-convex")]#[case(Some("posthog-dotnet/1.0.0"), "posthog-dotnet")]+ #[case(Some("posthog-aspnetcore/1.0.0"), "posthog-aspnetcore")]#[case(Some("posthog-elixir/0.2.0"), "posthog-elixir")]#[case(Some("posthog-rs/0.10.0"), "posthog-rs")]+ #[case(Some("posthog-server/1.0.0"), "posthog-server")]#[case(Some("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"),"browser"diff --git a/rust/feature-flags/src/handler/flags.rs b/rust/feature-flags/src/handler/flags.rsindex 7078291cb519..d7dd82fa6fb0 100644--- a/rust/feature-flags/src/handler/flags.rs+++ b/rust/feature-flags/src/handler/flags.rs@@ -617,6 +617,16 @@ mod tests {headers.insert("user-agent", "posthog-flutter/4.0.0".parse().unwrap());let result = detect_evaluation_runtime_from_request(&headers, None);assert_eq!(result, Some(EvaluationRuntime::Client));++ headers.clear();+ headers.insert("user-agent", "posthog-kmp/0.6.0".parse().unwrap());+ let result = detect_evaluation_runtime_from_request(&headers, None);+ assert_eq!(result, Some(EvaluationRuntime::Client));++ headers.clear();+ headers.insert("user-agent", "posthog-unity/4.5.0".parse().unwrap());+ let result = detect_evaluation_runtime_from_request(&headers, None);+ assert_eq!(result, Some(EvaluationRuntime::Client));}#[test]@@ -633,13 +643,20 @@ mod tests {fn test_detect_evaluation_runtime_all_server_sdks() {let server_sdks = vec!["posthog-python/1.4.0",+ "posthog-python-mcp/0.1.0","posthog-ruby/2.0.0","posthog-ruby2.0.0",+ "posthog-rails/3.18.0","posthog-php/3.0.0","posthog-java/1.0.0",+ "posthog-server/1.0.0","posthog-go/0.1.0","posthog-node/2.2.0",+ "posthog-node-mcp/0.7.0",+ "posthog-edge/2.2.0",+ "posthog-convex/0.2.0","posthog-dotnet/1.0.0",+ "posthog-aspnetcore/1.0.0","posthog-elixir/0.2.0","posthog-rs/0.10.0",];diff --git a/rust/feature-flags/src/handler/types.rs b/rust/feature-flags/src/handler/types.rsindex d255bc5c0625..6be4d11c03ae 100644--- a/rust/feature-flags/src/handler/types.rs+++ b/rust/feature-flags/src/handler/types.rs@@ -116,18 +116,30 @@ pub enum Library {PosthogJs,/// posthog-node SDK (server-side Node.js)PosthogNode,+ /// posthog-node-mcp integration+ PosthogNodeMcp,+ /// posthog-edge SDK+ PosthogEdge,+ /// posthog-convex integration+ PosthogConvex,/// posthog-python SDKPosthogPython,+ /// posthog-python-mcp integration+ PosthogPythonMcp,/// posthog-php SDKPosthogPhp,/// posthog-ruby SDKPosthogRuby,+ /// posthog-rails integration+ PosthogRails,/// posthog-go SDKPosthogGo,/// posthog-java SDKPosthogJava,/// posthog-dotnet SDKPosthogDotnet,+ /// posthog-aspnetcore integration+ PosthogAspnetcore,/// posthog-elixir SDKPosthogElixir,/// posthog-rs SDK@@ -140,6 +152,10 @@ pub enum Library {PosthogReactNative,/// posthog-flutter SDKPosthogFlutter,+ /// posthog-kmp SDK+ PosthogKmp,+ /// posthog-unity SDK+ PosthogUnity,/// posthog-server SDK (deprecated: users are migrating to posthog-java)PosthogServer,/// Unknown or unrecognized SDK@@ -155,18 +171,26 @@ impl Library {match self {Library::PosthogJs => "posthog-js",Library::PosthogNode => "posthog-node",+ Library::PosthogNodeMcp => "posthog-node-mcp",+ Library::PosthogEdge => "posthog-edge",+ Library::PosthogConvex => "posthog-convex",Library::PosthogPython => "posthog-python",+ Library::PosthogPythonMcp => "posthog-python-mcp",Library::PosthogPhp => "posthog-php",Library::PosthogRuby => "posthog-ruby",+ Library::PosthogRails => "posthog-rails",Library::PosthogGo => "posthog-go",Library::PosthogJava => "posthog-java",Library::PosthogDotnet => "posthog-dotnet",+ Library::PosthogAspnetcore => "posthog-aspnetcore",Library::PosthogElixir => "posthog-elixir",Library::PosthogRs => "posthog-rs",Library::PosthogAndroid => "posthog-android",Library::PosthogIos => "posthog-ios",Library::PosthogReactNative => "posthog-react-native",Library::PosthogFlutter => "posthog-flutter",+ Library::PosthogKmp => "posthog-kmp",+ Library::PosthogUnity => "posthog-unity",Library::PosthogServer => "posthog-server",Library::Other => "other",}@@ -178,18 +202,26 @@ impl Library {pub const ALL_KNOWN: &'static [Library] = &[Library::PosthogJs,Library::PosthogNode,+ Library::PosthogNodeMcp,+ Library::PosthogEdge,+ Library::PosthogConvex,Library::PosthogPython,+ Library::PosthogPythonMcp,Library::PosthogPhp,Library::PosthogRuby,+ Library::PosthogRails,Library::PosthogGo,Library::PosthogJava,Library::PosthogDotnet,+ Library::PosthogAspnetcore,Library::PosthogElixir,Library::PosthogRs,Library::PosthogAndroid,Library::PosthogIos,Library::PosthogReactNative,Library::PosthogFlutter,+ Library::PosthogKmp,+ Library::PosthogUnity,Library::PosthogServer,];}@@ -284,13 +316,19 @@ mod tests {#[rstest]// Server-side SDKs#[case("posthog-node/3.1.0", Library::PosthogNode)]+ #[case("posthog-node-mcp/0.7.0", Library::PosthogNodeMcp)]+ #[case("posthog-edge/3.1.0", Library::PosthogEdge)]+ #[case("posthog-convex/0.2.0", Library::PosthogConvex)]#[case("posthog-python/2.5.0", Library::PosthogPython)]+ #[case("posthog-python-mcp/0.1.0", Library::PosthogPythonMcp)]#[case("posthog-php/3.0.0", Library::PosthogPhp)]#[case("posthog-ruby/2.3.0", Library::PosthogRuby)]#[case("posthog-ruby2.3.0", Library::PosthogRuby)]+ #[case("posthog-rails/3.18.0", Library::PosthogRails)]#[case("posthog-go/1.0.0", Library::PosthogGo)]#[case("posthog-java/1.2.0", Library::PosthogJava)]#[case("posthog-dotnet/1.0.0", Library::PosthogDotnet)]+ #[case("posthog-aspnetcore/1.0.0", Library::PosthogAspnetcore)]#[case("posthog-elixir/0.2.0", Library::PosthogElixir)]#[case("posthog-rs/0.10.0", Library::PosthogRs)]#[case("posthog-server/1.0.0", Library::PosthogServer)]@@ -301,6 +339,8 @@ mod tests {#[case("posthog-ios/3.1.0", Library::PosthogIos)]#[case("posthog-react-native/2.0.0", Library::PosthogReactNative)]#[case("posthog-flutter/2.0.0", Library::PosthogFlutter)]+ #[case("posthog-kmp/0.6.0", Library::PosthogKmp)]+ #[case("posthog-unity/4.5.0", Library::PosthogUnity)]// Browser user-agents (detected as posthog-js)#[case("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", Library::PosthogJs)]#[case(@@ -370,18 +410,26 @@ mod tests {#[rstest]#[case(Library::PosthogJs, "posthog-js")]#[case(Library::PosthogNode, "posthog-node")]+ #[case(Library::PosthogNodeMcp, "posthog-node-mcp")]+ #[case(Library::PosthogEdge, "posthog-edge")]+ #[case(Library::PosthogConvex, "posthog-convex")]#[case(Library::PosthogPython, "posthog-python")]+ #[case(Library::PosthogPythonMcp, "posthog-python-mcp")]#[case(Library::PosthogPhp, "posthog-php")]#[case(Library::PosthogRuby, "posthog-ruby")]+ #[case(Library::PosthogRails, "posthog-rails")]#[case(Library::PosthogGo, "posthog-go")]#[case(Library::PosthogJava, "posthog-java")]#[case(Library::PosthogDotnet, "posthog-dotnet")]+ #[case(Library::PosthogAspnetcore, "posthog-aspnetcore")]#[case(Library::PosthogElixir, "posthog-elixir")]#[case(Library::PosthogRs, "posthog-rs")]#[case(Library::PosthogAndroid, "posthog-android")]#[case(Library::PosthogIos, "posthog-ios")]#[case(Library::PosthogReactNative, "posthog-react-native")]#[case(Library::PosthogFlutter, "posthog-flutter")]+ #[case(Library::PosthogKmp, "posthog-kmp")]+ #[case(Library::PosthogUnity, "posthog-unity")]#[case(Library::PosthogServer, "posthog-server")]#[case(Library::Other, "other")]fn test_library_display(#[case] library: Library, #[case] expected: &str) {@@ -391,18 +439,26 @@ mod tests {#[rstest]#[case(Library::PosthogJs, "\"posthog-js\"")]#[case(Library::PosthogNode, "\"posthog-node\"")]+ #[case(Library::PosthogNodeMcp, "\"posthog-node-mcp\"")]+ #[case(Library::PosthogEdge, "\"posthog-edge\"")]+ #[case(Library::PosthogConvex, "\"posthog-convex\"")]#[case(Library::PosthogPython, "\"posthog-python\"")]+ #[case(Library::PosthogPythonMcp, "\"posthog-python-mcp\"")]#[case(Library::PosthogPhp, "\"posthog-php\"")]#[case(Library::PosthogRuby, "\"posthog-ruby\"")]+ #[case(Library::PosthogRails, "\"posthog-rails\"")]#[case(Library::PosthogGo, "\"posthog-go\"")]#[case(Library::PosthogJava, "\"posthog-java\"")]#[case(Library::PosthogDotnet, "\"posthog-dotnet\"")]+ #[case(Library::PosthogAspnetcore, "\"posthog-aspnetcore\"")]#[case(Library::PosthogElixir, "\"posthog-elixir\"")]#[case(Library::PosthogRs, "\"posthog-rs\"")]#[case(Library::PosthogAndroid, "\"posthog-android\"")]#[case(Library::PosthogIos, "\"posthog-ios\"")]#[case(Library::PosthogReactNative, "\"posthog-react-native\"")]#[case(Library::PosthogFlutter, "\"posthog-flutter\"")]+ #[case(Library::PosthogKmp, "\"posthog-kmp\"")]+ #[case(Library::PosthogUnity, "\"posthog-unity\"")]#[case(Library::PosthogServer, "\"posthog-server\"")]#[case(Library::Other, "\"other\"")]fn test_library_serialization(#[case] library: Library, #[case] expected_json: &str) {diff --git a/rust/feature-flags/src/utils/user_agent.rs b/rust/feature-flags/src/utils/user_agent.rsindex 574edaef18d8..d48a55218a20 100644--- a/rust/feature-flags/src/utils/user_agent.rs+++ b/rust/feature-flags/src/utils/user_agent.rs@@ -100,12 +100,18 @@ impl UserAgentInfo {let (sdk_name, runtime) = match name {// Server-side SDKs"python" => ("posthog-python", RuntimeType::Server),+ "python-mcp" => ("posthog-python-mcp", RuntimeType::Server),"ruby" => ("posthog-ruby", RuntimeType::Server),+ "rails" => ("posthog-rails", RuntimeType::Server),"php" => ("posthog-php", RuntimeType::Server),"java" => ("posthog-java", RuntimeType::Server),"go" => ("posthog-go", RuntimeType::Server),"node" => ("posthog-node", RuntimeType::Server),+ "node-mcp" => ("posthog-node-mcp", RuntimeType::Server),+ "edge" => ("posthog-edge", RuntimeType::Server),+ "convex" => ("posthog-convex", RuntimeType::Server),"dotnet" => ("posthog-dotnet", RuntimeType::Server),+ "aspnetcore" => ("posthog-aspnetcore", RuntimeType::Server),"elixir" => ("posthog-elixir", RuntimeType::Server),"rs" => ("posthog-rs", RuntimeType::Server),// Deprecated: posthog-server users are migrating to posthog-java@@ -116,6 +122,8 @@ impl UserAgentInfo {"ios" => ("posthog-ios", RuntimeType::Client),"react-native" => ("posthog-react-native", RuntimeType::Client),"flutter" => ("posthog-flutter", RuntimeType::Client),+ "kmp" => ("posthog-kmp", RuntimeType::Client),+ "unity" => ("posthog-unity", RuntimeType::Client),// Unknown SDK - don't set sdk_name for unrecognized SDKs_ => return Self::unknown(),};@@ -218,12 +226,42 @@ mod tests {Some("1.2.3"),RuntimeType::Server)]+ #[case(+ "posthog-node-mcp/0.7.0",+ Some("posthog-node-mcp"),+ Some("0.7.0"),+ RuntimeType::Server+ )]+ #[case(+ "posthog-edge/1.2.3",+ Some("posthog-edge"),+ Some("1.2.3"),+ RuntimeType::Server+ )]+ #[case(+ "posthog-convex/0.2.0",+ Some("posthog-convex"),+ Some("0.2.0"),+ RuntimeType::Server+ )]+ #[case(+ "posthog-python-mcp/0.1.0",+ Some("posthog-python-mcp"),+ Some("0.1.0"),+ RuntimeType::Server+ )]#[case("posthog-ruby/2.0.0",Some("posthog-ruby"),Some("2.0.0"),RuntimeType::Server)]+ #[case(+ "posthog-rails/3.18.0",+ Some("posthog-rails"),+ Some("3.18.0"),+ RuntimeType::Server+ )]#[case("posthog-ruby2.0.0",Some("posthog-ruby"),@@ -260,6 +298,12 @@ mod tests {Some("1.0.0"),RuntimeType::Server)]+ #[case(+ "posthog-aspnetcore/1.0.0",+ Some("posthog-aspnetcore"),+ Some("1.0.0"),+ RuntimeType::Server+ )]#[case("posthog-elixir/0.2.0",Some("posthog-elixir"),@@ -314,6 +358,18 @@ mod tests {Some("4.0.0"),RuntimeType::Client)]+ #[case(+ "posthog-kmp/0.6.0",+ Some("posthog-kmp"),+ Some("0.6.0"),+ RuntimeType::Client+ )]+ #[case(+ "posthog-unity/4.5.0",+ Some("posthog-unity"),+ Some("4.5.0"),+ RuntimeType::Client+ )]#[case("posthog-python/3.0.0 (Linux; Python 3.11)",Some("posthog-python"),@@ -388,14 +444,22 @@ mod tests {#[case(Some("posthog-ios/3.0.0"), "posthog-ios")]#[case(Some("posthog-react-native/2.5.0"), "posthog-react-native")]#[case(Some("posthog-flutter/4.0.0"), "posthog-flutter")]+ #[case(Some("posthog-kmp/0.6.0"), "posthog-kmp")]+ #[case(Some("posthog-unity/4.5.0"), "posthog-unity")]#[case(Some("posthog-python/1.4.0"), "posthog-python")]+ #[case(Some("posthog-python-mcp/0.1.0"), "posthog-python-mcp")]#[case(Some("posthog-ruby/2.0.0"), "posthog-ruby")]+ #[case(Some("posthog-rails/3.18.0"), "posthog-rails")]#[case(Some("posthog-ruby2.0.0"), "posthog-ruby")]#[case(Some("posthog-php/3.0.0"), "posthog-php")]#[case(Some("posthog-java/1.0.0"), "posthog-java")]#[case(Some("posthog-go/0.1.0"), "posthog-go")]#[case(Some("posthog-node/2.2.0"), "posthog-node")]+ #[case(Some("posthog-node-mcp/0.7.0"), "posthog-node-mcp")]+ #[case(Some("posthog-edge/2.2.0"), "posthog-edge")]+ #[case(Some("posthog-convex/0.2.0"), "posthog-convex")]#[case(Some("posthog-dotnet/1.0.0"), "posthog-dotnet")]+ #[case(Some("posthog-aspnetcore/1.0.0"), "posthog-aspnetcore")]#[case(Some("posthog-elixir/0.2.0"), "posthog-elixir")]#[case(Some("posthog-rs/0.10.0"), "posthog-rs")]#[case(Some("posthog-server/1.0.0"), "posthog-server")]@@ -423,9 +487,17 @@ mod tests {#[rstest]#[case("posthog-python/3.0.0", Some("posthog-python"))]#[case("posthog-node/1.2.3", Some("posthog-node"))]+ #[case("posthog-node-mcp/0.7.0", Some("posthog-node-mcp"))]+ #[case("posthog-edge/1.2.3", Some("posthog-edge"))]+ #[case("posthog-convex/0.2.0", Some("posthog-convex"))]+ #[case("posthog-python-mcp/0.1.0", Some("posthog-python-mcp"))]#[case("posthog-ruby2.0.0", Some("posthog-ruby"))]+ #[case("posthog-rails/3.18.0", Some("posthog-rails"))]+ #[case("posthog-aspnetcore/1.0.0", Some("posthog-aspnetcore"))]#[case("posthog-rs/0.10.0", Some("posthog-rs"))]#[case("posthog-android/3.0.0", Some("posthog-android"))]+ #[case("posthog-kmp/0.6.0", Some("posthog-kmp"))]+ #[case("posthog-unity/4.5.0", Some("posthog-unity"))]#[case("posthog-server/1.0.0", Some("posthog-server"))]#[case("Mozilla/5.0 (Windows NT 10.0; Win64; x64)", Some("web"))]#[case("Chrome/120.0.0.0 Safari/537.36", Some("web"))]