-
Notifications
You must be signed in to change notification settings - Fork 1
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
Log metadata diffs on upserts #208
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #208 +/- ##
==========================================
- Coverage 72.46% 72.27% -0.20%
==========================================
Files 10 10
Lines 810 844 +34
==========================================
+ Hits 587 610 +23
- Misses 163 169 +6
- Partials 60 65 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
f3e32ed
to
d8d36e3
Compare
Before performing an upsert, log the differences between the existing metadata and the new metadata. This will help us understand what is happening when we see unexpected changes in the metadata.
d8d36e3
to
c10f7a0
Compare
|
||
existingMetadata, err := models.FindInstanceMetadatum(c.Request.Context(), r.DB, instanceID) | ||
if err != nil && !errors.Is(err, sql.ErrNoRows) { | ||
r.Logger.Sugar().Info("Upsert metadata diff for instance ", instanceID, ": this is the first metadata for this instance (sql.ErrNoRows)") |
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 suspect this is going to be really noisy and not very helpful to have to weed out, doesn't feel necessary to log this condition.
} | ||
|
||
if existingMetadata == nil { | ||
r.Logger.Sugar().Info("Upsert metadata diff for instance ", instanceID, ": this is the first metadata for this instance") |
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.
ditto
Before performing an upsert, log the differences between the existing metadata and the new metadata. This will help us understand what is happening when we see unexpected changes in the metadata.