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: move tracking of important events #25152

Merged
merged 37 commits into from
Oct 2, 2024

Conversation

raquelmsmith
Copy link
Member

@raquelmsmith raquelmsmith commented Sep 23, 2024

Problem

Our product intelligence sometimes gets blocked. It will be more reliable on the server.

Move the following to the server (or make sure they are there):

  • Start using
    • onboarding product selected
  • Product analytics
    • dashboard created
    • insight created / saved
    • first team event ingested
  • Platform
    • invited team member
  • Surveys
    • survey launched
  • Feature flags
    • feature flag created (already backend)
  • Session replay
    • recording analyzed
    • list filter changed

Changes

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

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

How did you test this code?

Copy link
Contributor

github-actions bot commented Sep 23, 2024

Size Change: -842 B (-0.01%)

Total Size: 9.21 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 9.21 MB -842 B (-0.01%)

compressed-size-action

@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 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@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 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@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.

@raquelmsmith raquelmsmith marked this pull request as ready for review October 1, 2024 19:07
@raquelmsmith raquelmsmith requested review from pauldambra, a team and dmarticus October 1, 2024 19:08
Copy link
Contributor

@zlwaterfield zlwaterfield left a comment

Choose a reason for hiding this comment

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

Nice work, I know this was a lot of work. Added a few questions but overall looks good.


if "viewed" in serializer.validated_data and not request.user.is_anonymous:
recording.check_viewed_for_user(user, save_viewed=True)
# TODO: make sure this has all the props we want
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this todo stay?

"start_date": instance.start_date,
"end_date": instance.end_date,
}
if before_update.start_date is None and instance.start_date is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Clever way of doing this

@@ -344,6 +356,8 @@ def create(self, validated_data: dict, *args: Any, **kwargs: Any) -> Insight:
request = self.context["request"]
tags = validated_data.pop("tags", None) # tags are created separately as global tag relationships
team_id = self.context["team_id"]
current_url = request.headers.get("Referer")
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure this Referer property is the way to get the current URL? Will proxies / other things affect this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure. I don't think proxies will matter much because we don't proxy our API urls. If you have a better suggestion then I'm all ears. I'll also ask in dev.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

@dmarticus dmarticus left a comment

Choose a reason for hiding this comment

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

everything looks fine in the feature success domain!

@raquelmsmith raquelmsmith merged commit ddede4d into master Oct 2, 2024
93 checks passed
@raquelmsmith raquelmsmith deleted the chore/move-tracking-to-backend branch October 2, 2024 21:06
Copy link

sentry-io bot commented Oct 3, 2024

Suspect Issues

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

  • ‼️ CHQueryErrorNetworkError: DB::NetException. DB::NetException: SSL connection unexpectedly closed, while reading from socket... /api/projects/{parent_lookup_team_id}/session_r... View Issue
  • ‼️ NetworkError: Connection refused (ch-online.posthog.net:9440) /api/projects/{parent_lookup_team_id}/session_r... View Issue
  • ‼️ CHQueryErrorQueryWasCancelled: DB::Exception: Received from ch20.posthog.net:9000. DB::Exception: Query was cancelled. Stack trace: /api/projects/{parent_lookup_team_id}/session_r... View Issue
  • ‼️ **CHQueryErrorAllConnectionTriesFailed: DB::NetException. DB::NetException: All connection tries failed. Log: ** /api/projects/{parent_lookup_team_id}/session_r... 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.

5 participants