Skip to content

Commit

Permalink
fix: js lite usage reports (#26613)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Dec 4, 2024
1 parent 9838251 commit dae4d17
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
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

0 comments on commit dae4d17

Please sign in to comment.