Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: js lite usage reports #26613

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion plugin-server/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ export const KNOWN_LIB_VALUES = new Set([
'posthog-python',
'',
'js',
'posthog-js-lite',
'posthog-node',
'posthog-react-native',
'posthog-ruby',
Expand Down
2 changes: 1 addition & 1 deletion posthog/tasks/test/__snapshots__/test_usage_report.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -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', JSONExtractString(properties, '$lib') = 'web', 'web_events', JSONExtractString(properties, '$lib') = 'posthog-js-lite', 'web_lite_events', JSONExtractString(properties, '$lib') = 'posthog-node', 'node_events', JSONExtractString(properties, '$lib') = 'posthog-android', 'android_events', JSONExtractString(properties, '$lib') = 'posthog-flutter', 'flutter_events', JSONExtractString(properties, '$lib') = 'posthog-ios', 'ios_events', JSONExtractString(properties, '$lib') = 'posthog-go', 'go_events', JSONExtractString(properties, '$lib') = 'posthog-java', 'java_events', JSONExtractString(properties, '$lib') = 'posthog-react-native', 'react_native_events', JSONExtractString(properties, '$lib') = 'posthog-ruby', 'ruby_events', JSONExtractString(properties, '$lib') = 'posthog-python', 'python_events', JSONExtractString(properties, '$lib') = 'posthog-php', 'php_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', JSONExtractString(properties, '$lib') = 'web', 'web_events', JSONExtractString(properties, '$lib') = 'js', 'web_lite_events', JSONExtractString(properties, '$lib') = 'posthog-node', 'node_events', JSONExtractString(properties, '$lib') = 'posthog-android', 'android_events', JSONExtractString(properties, '$lib') = 'posthog-flutter', 'flutter_events', JSONExtractString(properties, '$lib') = 'posthog-ios', 'ios_events', JSONExtractString(properties, '$lib') = 'posthog-go', 'go_events', JSONExtractString(properties, '$lib') = 'posthog-java', 'java_events', JSONExtractString(properties, '$lib') = 'posthog-react-native', 'react_native_events', JSONExtractString(properties, '$lib') = 'posthog-ruby', 'ruby_events', JSONExtractString(properties, '$lib') = 'posthog-python', 'python_events', JSONExtractString(properties, '$lib') = 'posthog-php', 'php_events', 'other') AS metric,
count(1) as count
FROM events
WHERE timestamp BETWEEN '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
Expand Down
2 changes: 1 addition & 1 deletion posthog/tasks/test/test_usage_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def _create_sample_usage_data(self) -> None:
# Add events for each SDK
sdks = [
"web",
"posthog-js-lite",
"js",
"posthog-node",
"posthog-android",
"posthog-flutter",
Expand Down
2 changes: 1 addition & 1 deletion posthog/tasks/usage_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def get_all_event_metrics_in_period(begin: datetime, end: datetime) -> dict[str,
event LIKE 'keywords_ai%%', 'keywords_ai_events',
event LIKE 'traceloop%%', 'traceloop_events',
{lib_expression} = 'web', 'web_events',
{lib_expression} = 'posthog-js-lite', 'web_lite_events',
{lib_expression} = 'js', 'web_lite_events',
{lib_expression} = 'posthog-node', 'node_events',
{lib_expression} = 'posthog-android', 'android_events',
{lib_expression} = 'posthog-flutter', 'flutter_events',
Expand Down
Loading