-
Notifications
You must be signed in to change notification settings - Fork 322
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
fix: changing eventNames longer than configured max length to ":max-length-exceeded:" before sending to reporting #4244
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChat with CodeRabbit Bot (
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4244 +/- ##
==========================================
+ Coverage 73.81% 73.90% +0.08%
==========================================
Files 388 388
Lines 54835 54839 +4
==========================================
+ Hits 40478 40527 +49
+ Misses 12036 11991 -45
Partials 2321 2321 ☔ View full report in Codecov by Sentry. |
enterprise/reporting/reporting.go
Outdated
@@ -589,6 +589,10 @@ func (r *DefaultReporter) Report(ctx context.Context, metrics []*types.PUReporte | |||
metric = transformMetricForPII(metric, getPIIColumnsToExclude()) | |||
} | |||
|
|||
if len(metric.StatusDetail.EventName) > config.GetInt("Reporting.eventNameMaxLength", 100) { |
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.
why don't we trim down event names instead to the first 100 characters?
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.
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.
Cardinality can be a serious issue even with event names having less than 100 characters though, e.g. a uuid is 36 characters and ksuid is 28 characters.
Why are we coupling it with the length of characters?
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.
Initial thought is to trim them but when we looked at the data, 99.55% of eventNames longer than 100 characters are stringified JSONs or URLs. And rest of them can also be avoided with good instrumentation. So, we decided to go with this as this will also help with cardinality.
Description
To reduce events with junk eventNames, adding a restriction on length of eventName. Added a configuration, if a valid max length is given, it replaces eventName (if it is longer than max length) to :max-length-exceeded:. How to show this in UI will be handled in web-app.
Default for the config is set to zero, which will not change anything.
More details in linear ticket and attached notion doc in it.
Completes OBS-126
Linear Ticket
https://linear.app/rudderstack/issue/OBS-126/validate-eventname-in-reports
Security