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

chore: use $exception_issue_id #26488

Merged
merged 10 commits into from
Nov 28, 2024
Merged

chore: use $exception_issue_id #26488

merged 10 commits into from
Nov 28, 2024

Conversation

daibhin
Copy link
Contributor

@daibhin daibhin commented Nov 27, 2024

Problem

$exception_fingerprint is no longer the unique identifier of an issue

Changes

  • Rename "groups" to be "issues"
  • Use the issue_id on an event for grouping purposes

Note: this does not support issue merging via the overrides table. That will come in a follow up PR. I thought it would be simpler to do a direct renaming PR first

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Updated all the tests. We need to create an ErrorTrackingIssue for each event we have as we no longer lazily create those models

Comment on lines 158 to 160
const where = [
`has(${stringifyFingerprints(
fingerprints
)}, JSONExtract(ifNull(properties.$exception_fingerprint,'[]'),'Array(String)'))`,
]
// TODO: fix this where clause. It does not take into account the events
// associated with issues that have been merged into this primary issue
const where = [`eq(${issueId}, properties.$exception_issue_id`]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to come back to this but think it's ok for now. Basically we piggy back on top of the EventsQuery to fetch individual exceptions for an issue. Because we no longer have all the merged_fingerprints associated with an issue model in PG we cannot filter the query.

I think what we'll end up doing here is returning issue_ids as a field on the ErrorTrackingIssueQueryResponse object (computed as groupUniqArray(properties.$exception_issue_id)) which can be reused to fetch individual events. I just want to confirm that the groupUniqArray doesn't make the query slow

Copy link
Contributor

Choose a reason for hiding this comment

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

We'll need to hit the overrides table here, right? Same kind of query as getting the events for a person profile?

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

github-actions bot commented Nov 27, 2024

Size Change: -222 B (-0.02%)

Total Size: 1.16 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.16 MB -222 B (-0.02%)

compressed-size-action

@daibhin daibhin requested a review from oliverb123 November 27, 2024 22:08
Copy link
Contributor

@oliverb123 oliverb123 left a comment

Choose a reason for hiding this comment

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

Kind of stumbling in the dark on a lot of the query stuff here but overall seems reasonable

frontend/src/lib/api.ts Outdated Show resolved Hide resolved
frontend/src/lib/api.ts Outdated Show resolved Hide resolved
frontend/src/lib/api.ts Outdated Show resolved Hide resolved
frontend/src/lib/api.ts Outdated Show resolved Hide resolved
posthog/hogql_queries/error_tracking_query_runner.py Outdated Show resolved Hide resolved
@daibhin daibhin merged commit 218bfdf into master Nov 28, 2024
96 checks passed
@daibhin daibhin deleted the dn-chore/use-issue-id branch November 28, 2024 16:15
Copy link

sentry-io bot commented Dec 2, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: expected string or bytes-like object, got 'proxy' /api/environments/{parent_lookup_team_id}/query/ View Issue

Did you find this useful? React with a 👍 or 👎

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.

3 participants