-
Notifications
You must be signed in to change notification settings - Fork 28
Chore/general client analytics #394
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 05e1832 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| intermediateQuery += | ||
| queryParams.length === 0 | ||
| ? ` WHERE connected_at >= $1 AND connected_at <= $2` | ||
| : ` AND connected_at >= $${queryParams.length + 1} AND connected_at <= $${queryParams.length + 2}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to add multiple WHERE clauses if both date_range and client_id/user_id is specified - will this work? Same for cursor below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It builds up the query based on the query parameter legth and the adds a and or where, I have added some tests to validate functionality. The query looks like this:
SELECT id, user_id, client_id, user_agent, sdk, jwt_exp::text AS jwt_exp, disconnected_at, connected_at::text AS connected_at, disconnected_at::text AS disconnected_at FROM connection_report_events WHERE client_id = $1 AND user_id = $2 AND connected_at >= $3 AND connected_at <= $4 ORDER BY connected_at DESC
Added general connection analytics query for Mongo and Postgres report storage.
Query will return a paginated list of connections which can be filtered by:
Purpose: Ability to get more granular user/client specific connection data.
Bugfix:
report update UTC time for PostgresReportStorage