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

feat(metrics): Always extract distinct_id [INGEST-1330] #1275

Merged
merged 8 commits into from
May 19, 2022

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented May 18, 2022

The javascript SDK apparently does not always send a session.distinct_id with the initial session update, but only on subsequent updates.

To make sure we count those users as well, extract them under the tag session.status=ok. We will need to update queries in sentry to include these users.

@jjbayer jjbayer marked this pull request as ready for review May 18, 2022 15:01
@jjbayer jjbayer requested a review from a team May 18, 2022 15:01
CHANGELOG.md Outdated
@@ -6,6 +6,10 @@

**Features**:

- Session metrics extraction: Always extract distinct_id. ([#1275](https://github.com/getsentry/relay/pull/1275))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would classify this under bug fixes and describe what the user-visible effect of this is, or rather what the bug was.

relay-server/src/metrics_extraction/sessions.rs Outdated Show resolved Hide resolved
jjbayer and others added 2 commits May 19, 2022 08:53
@jjbayer jjbayer merged commit 86bafc5 into master May 19, 2022
@jjbayer jjbayer deleted the feat/metrics-extract-ok-users branch May 19, 2022 12:23
jjbayer added a commit to getsentry/sentry that referenced this pull request May 23, 2022
The javascript SDK apparently does not always send a session.distinct_id
with the initial session update, but only on subsequent updates.

To make sure we count those users as well, Relay now extracts them under
the tag session.status=ok (See also getsentry/relay#1275).

This PR changes existing metrics user queries in one of two ways:

Wherever we filtered users by status=init, remove the filter. Wherever
we grouped by status to get multiple user counts, change the query to a
conditional aggregate (uniqIf), so that we get both the total user count
(unfiltered) and the user counts filtered to specific tags.
jjbayer added a commit that referenced this pull request Jun 23, 2022
Since #1275, we extract user IDs into one or more of init, ok, errored,
crashed, abnormal buckets. The latter three are used by the product, but
init and ok can be consolidated into a single tag, because the product
does not query them explicitily as of getsentry/sentry#34858 and
getsentry/sentry#34957.

In order to reduce the number of buckets stored in clickhouse,
consolidate these tags.

Also, stop collecting session.duration for non-healthy sessions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants