-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(analytics): Transform analytics events for TET-827 #95207
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
Open
constantinius
wants to merge
11
commits into
master
Choose a base branch
from
constantinius/ref/analytics/tet-827
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e0fe946
ref(analytics): Transform analytics events for TET-827
constantinius fb47d22
Merge branch 'master' into constantinius/ref/analytics/tet-827
constantinius 93baae2
Merge branch 'master' into constantinius/ref/analytics/tet-827
constantinius 2c18bc1
test(analytics): add assert_last_analytics_event for testing
constantinius 9746ca6
test(analytics): fix testing analytics in onboarding
constantinius e8b551f
test(analytics): fix testing analytics in test_signals
constantinius a68628d
test(analytics): fix tests in test_organization_group_index
constantinius 063d3b3
test(analytics) fix tests in test_issues
constantinius 4867cdb
fix(analytics): mypy type issues
constantinius d96e6a3
fix(analytics): wrong field types. test fixes
constantinius 5bc2592
Merge branch 'master' into constantinius/ref/analytics/tet-827
constantinius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 4 additions & 7 deletions
11
src/sentry/analytics/events/advanced_search_feature_gated.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("advanced_search.feature_gated") | ||
class AdvancedSearchFeatureGateEvent(analytics.Event): | ||
type = "advanced_search.feature_gated" | ||
|
||
attributes = ( | ||
analytics.Attribute("user_id", required=False), | ||
analytics.Attribute("default_user_id"), | ||
analytics.Attribute("organization_id"), | ||
) | ||
user_id: str | None = None | ||
default_user_id: str | ||
organization_id: str | ||
|
||
|
||
analytics.register(AdvancedSearchFeatureGateEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("alert.edited") | ||
class AlertEditedEvent(analytics.Event): | ||
type = "alert.edited" | ||
|
||
attributes = ( | ||
analytics.Attribute("user_id", required=False), | ||
analytics.Attribute("default_user_id"), | ||
analytics.Attribute("organization_id"), | ||
analytics.Attribute("rule_id"), | ||
analytics.Attribute("rule_type"), | ||
analytics.Attribute("is_api_token"), | ||
) | ||
user_id: str | None = None | ||
default_user_id: str | ||
organization_id: str | ||
rule_id: str | ||
rule_type: str | ||
is_api_token: str | ||
|
||
|
||
analytics.register(AlertEditedEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("first_new_feedback.sent") | ||
class FirstNewFeedbackSentEvent(analytics.Event): | ||
type = "first_new_feedback.sent" | ||
|
||
attributes = ( | ||
analytics.Attribute("organization_id"), | ||
analytics.Attribute("project_id"), | ||
analytics.Attribute("platform", required=False), | ||
analytics.Attribute("user_id", required=False), | ||
) | ||
organization_id: str | ||
project_id: str | ||
platform: str | None = None | ||
user_id: int | None = None | ||
|
||
|
||
analytics.register(FirstNewFeedbackSentEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("issue.assigned") | ||
class IssueAssignedEvent(analytics.Event): | ||
type = "issue.assigned" | ||
|
||
attributes = ( | ||
analytics.Attribute("user_id", required=False), | ||
analytics.Attribute("default_user_id"), | ||
analytics.Attribute("organization_id"), | ||
analytics.Attribute("group_id"), | ||
) | ||
user_id: str | None = None | ||
default_user_id: str | ||
organization_id: str | ||
group_id: str | ||
|
||
|
||
analytics.register(IssueAssignedEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("issue.deleted") | ||
class IssueDeletedEvent(analytics.Event): | ||
type = "issue.deleted" | ||
|
||
attributes = ( | ||
analytics.Attribute("group_id"), | ||
analytics.Attribute("delete_type"), | ||
analytics.Attribute("organization_id"), | ||
analytics.Attribute("project_id"), | ||
analytics.Attribute("user_id", required=False), | ||
analytics.Attribute("default_user_id"), | ||
) | ||
group_id: str | ||
delete_type: str | ||
organization_id: str | ||
project_id: str | ||
user_id: str | None = None | ||
default_user_id: str | ||
|
||
|
||
analytics.register(IssueDeletedEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("issue.escalating") | ||
class IssueEscalatingEvent(analytics.Event): | ||
type = "issue.escalating" | ||
|
||
attributes = ( | ||
analytics.Attribute("organization_id", type=int), | ||
analytics.Attribute("project_id", type=int), | ||
analytics.Attribute("group_id"), | ||
analytics.Attribute("event_id", required=False), | ||
analytics.Attribute("was_until_escalating"), | ||
) | ||
organization_id: int | ||
project_id: int | ||
group_id: str | ||
event_id: str | None = None | ||
was_until_escalating: str | ||
|
||
|
||
analytics.register(IssueEscalatingEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("issue.mark_reviewed") | ||
class IssueMarkReviewedEvent(analytics.Event): | ||
type = "issue.mark_reviewed" | ||
|
||
attributes = ( | ||
analytics.Attribute("user_id", required=False), | ||
analytics.Attribute("default_user_id"), | ||
analytics.Attribute("organization_id"), | ||
analytics.Attribute("group_id"), | ||
) | ||
user_id: str | None = None | ||
default_user_id: str | ||
organization_id: str | ||
group_id: str | ||
|
||
|
||
analytics.register(IssueMarkReviewedEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("issue.resolved") | ||
class IssueResolvedEvent(analytics.Event): | ||
type = "issue.resolved" | ||
|
||
attributes = ( | ||
analytics.Attribute("user_id", required=False), | ||
analytics.Attribute("project_id", required=False), | ||
analytics.Attribute("default_user_id"), | ||
analytics.Attribute("organization_id"), | ||
analytics.Attribute("group_id"), | ||
analytics.Attribute("resolution_type"), | ||
# TODO: make required once we validate that all events have this | ||
analytics.Attribute("issue_category", required=False), | ||
analytics.Attribute("issue_type", required=False), | ||
) | ||
user_id: int | None = None | ||
project_id: int | None = None | ||
default_user_id: str | ||
organization_id: int | ||
group_id: int | ||
resolution_type: str | ||
# TODO: make required once we validate that all events have this | ||
issue_category: str | None = None | ||
issue_type: str | None = None | ||
|
||
|
||
analytics.register(IssueResolvedEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("issue.unignored") | ||
class IssueUnignoredEvent(analytics.Event): | ||
type = "issue.unignored" | ||
|
||
attributes = ( | ||
analytics.Attribute("user_id", type=int, required=False), | ||
analytics.Attribute("default_user_id", type=int), | ||
analytics.Attribute("organization_id", type=int), | ||
analytics.Attribute("group_id"), | ||
analytics.Attribute("transition_type"), | ||
) | ||
user_id: int | None = None | ||
default_user_id: int | ||
organization_id: int | ||
group_id: str | ||
transition_type: str | ||
|
||
|
||
analytics.register(IssueUnignoredEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("onboarding.complete") | ||
class OnboardingCompleteEvent(analytics.Event): | ||
type = "onboarding.complete" | ||
|
||
attributes = ( | ||
analytics.Attribute("user_id"), | ||
analytics.Attribute("organization_id"), | ||
analytics.Attribute("referrer"), | ||
) | ||
user_id: int | ||
organization_id: int | ||
referrer: str | ||
|
||
|
||
analytics.register(OnboardingCompleteEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("plugin.enabled") | ||
class PluginEnabledEvent(analytics.Event): | ||
type = "plugin.enabled" | ||
|
||
attributes = ( | ||
analytics.Attribute("user_id"), | ||
analytics.Attribute("organization_id"), | ||
analytics.Attribute("project_id"), | ||
analytics.Attribute("plugin"), | ||
) | ||
user_id: int | None | ||
organization_id: str | ||
project_id: str | ||
plugin: str | ||
|
||
|
||
analytics.register(PluginEnabledEvent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
from sentry import analytics | ||
|
||
|
||
@analytics.eventclass("repo.linked") | ||
class RepoLinkedEvent(analytics.Event): | ||
type = "repo.linked" | ||
|
||
attributes = ( | ||
analytics.Attribute("user_id", required=False), | ||
analytics.Attribute("default_user_id"), | ||
analytics.Attribute("organization_id"), | ||
analytics.Attribute("repository_id"), | ||
analytics.Attribute("provider"), | ||
) | ||
user_id: str | None = None | ||
default_user_id: str | ||
organization_id: str | ||
repository_id: str | ||
provider: str | ||
|
||
|
||
analytics.register(RepoLinkedEvent) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 wasn'trequired=False
previouslyoh, i see at the callsite
user_id=user.id if user else None,