-
Notifications
You must be signed in to change notification settings - Fork 115
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
RSDK-9345 Deduplicate noisy logs #4564
Conversation
7696072
to
ffde341
Compare
d55ea23
to
afe9b2e
Compare
logging/impl_test.go
Outdated
assertLogMatches(t, notStdout, | ||
`2023-10-30T13:19:45.806Z INFO impl logging/impl_test.go:132 foo {"key":"value"}`) | ||
|
||
// TODO(benji): Add the following assertions to test more deduplication logic. |
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.
Still working on testing a bit, but thought I'd throw this into review before the holiday.
4e396d9
to
72eb311
Compare
Still adding remaining tests and then will re-request review. |
Added and requested. |
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.
LGTM
|
||
imp.testHelper() | ||
for _, appender := range imp.appenders { | ||
err := appender.Write(collapsedEntry.Entry, collapsedEntry.Fields) |
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.
The level of the aggregation log that's output here is equivalent to the most recent noisy log's level. You'll see in the test I wrote that this means that if I log 3 identical INFO logs followed by a 4th identical ERROR log, the aggregation log will appear as ERROR level. This is sort of strange, but I'm inclined to not care too much about this case since most identical logs will not differ in level. I suppose this raises the question of whether or not level should be considered as part of identicality but I'll stick to the scope for now.
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.
I'm fine with the behavior you described.
config/proto_conversions.go
Outdated
@@ -106,6 +106,10 @@ func FromProto(proto *pb.RobotConfig, logger logging.Logger) (*Config, error) { | |||
cfg.MaintenanceConfig = maintenanceConfig | |||
} | |||
|
|||
if proto.DisableLogDeduplication { |
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.
I agree this is correct because cfg
is default initialized, but this feels like the seedling of a bug. cfg.DisableLogDeduplication = proto.DisableLogDeduplication
is less lines and isn't prone to the default initialization value assumption.
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.
...I have no idea what I was thinking here haha. Switched to cfg.DisableLogDeduplication = proto.DisableLogDeduplication
.
RSDK-9345
Main changes:
disable_log_deduplication
JSON flag to potentially disable the logic described in the above two pointsTesting changes: