-
Notifications
You must be signed in to change notification settings - Fork 297
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: add provision to disable tracking event names from a source for reporting #3632
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3632 +/- ##
==========================================
+ Coverage 68.09% 68.11% +0.01%
==========================================
Files 318 318
Lines 50364 50371 +7
==========================================
+ Hits 34295 34308 +13
+ Misses 13848 13840 -8
- Partials 2221 2223 +2
☔ View full report in Codecov by Sentry. |
enterprise/reporting/reporting.go
Outdated
sourcesWithEventNameTrackingDisabledEnv := config.GetString("SOURCES_WITH_EVENT_NAME_TRACKING_DISABLED", "") | ||
sourcesWithEventNameTrackingDisabled := []string{} | ||
if len(sourcesWithEventNameTrackingDisabledEnv) > 0 { | ||
sourcesWithEventNameTrackingDisabled = strings.Split(sourcesWithEventNameTrackingDisabledEnv, ",") | ||
} |
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.
GetStringSlice
can be used instead.
sourcesWithEventNameTrackingDisabledEnv := config.GetString("SOURCES_WITH_EVENT_NAME_TRACKING_DISABLED", "") | |
sourcesWithEventNameTrackingDisabled := []string{} | |
if len(sourcesWithEventNameTrackingDisabledEnv) > 0 { | |
sourcesWithEventNameTrackingDisabled = strings.Split(sourcesWithEventNameTrackingDisabledEnv, ",") | |
} | |
sourcesWithEventNameTrackingDisabled := config.GetStringSlice("SOURCES_WITH_EVENT_NAME_TRACKING_DISABLED", "") |
enterprise/reporting/reporting.go
Outdated
if r.IsEventNameTrackingDisabledForSource(metric.ConnectionDetails.SourceID) { | ||
metric = transformMetricForEventNameTrackingDisabled(metric) | ||
} | ||
|
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.
A few suggestions that are somewhat idiomatic and a bit subjective:
- I would use slices.Contains, for consistency and readability.
- I would not create new functions since the logic they are encapsulating is so simple, one line each assuming
slices.Contains
is used.
if r.IsEventNameTrackingDisabledForSource(metric.ConnectionDetails.SourceID) { | |
metric = transformMetricForEventNameTrackingDisabled(metric) | |
} | |
if slices.Contains(sourcesWithEventNameTrackingDisabled, metric.ConnectionDetails.SourceID) { | |
metric.StatusDetail.EventName = metric.StatusDetail.EventType | |
} |
@lvrach addressed the review comments |
Description
event_name
field. These were all user_ids. This causes cardinality increase in reportingevent_name
tracking for reporting from sourceNotion Ticket
https://www.notion.so/rudderstacks/Reports-Flush-Issue-from-Rudder-Server-Instance-9-on-prousmtusmt-c9592bd2b2b74d05a9e083ad8baa7988
Security