Skip to content

services/snapshots: include name of snapshotter in debug logs#10919

Merged
mxpv merged 1 commit into
containerd:mainfrom
thaJeztah:snapshot_logs_structured
Nov 1, 2024
Merged

services/snapshots: include name of snapshotter in debug logs#10919
mxpv merged 1 commit into
containerd:mainfrom
thaJeztah:snapshot_logs_structured

Conversation

@thaJeztah

Copy link
Copy Markdown
Member
  • combine consecutive "WithField" calls to "WithFields", as multiple calls is known to be expensive.
  • include a "snapshotter" field in logs to allow correlating actions with specific snapshotters.

dmcgowan
dmcgowan previously approved these changes Oct 31, 2024
Comment thread plugins/services/snapshots/service.go Outdated

func (s *service) Commit(ctx context.Context, cr *snapshotsapi.CommitSnapshotRequest) (*ptypes.Empty, error) {
log.G(ctx).WithField("key", cr.Key).WithField("name", cr.Name).Debugf("commit snapshot")
log.G(ctx).WithFields(log.Fields{"key": cr.Key, "snapshotter": cr.Snapshotter}).Debugf("commit snapshot")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name got removed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh, good catch; sorry for that 🙈 updated 👍

@dmcgowan dmcgowan dismissed their stale review October 31, 2024 15:17

Needs update

- combine consecutive "WithField" calls to "WithFields", as multiple
  calls is known to be expensive.
- include a "snapshotter" field in logs to allow correlating actions
  with specific snapshotters.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the snapshot_logs_structured branch from 4f301a2 to 4594f5c Compare October 31, 2024 17:00
@mxpv mxpv added this pull request to the merge queue Nov 1, 2024
Merged via the queue into containerd:main with commit 92b46e1 Nov 1, 2024
@samuelkarp samuelkarp added cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Nov 1, 2024
@austinvazquez austinvazquez added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch kind/refactor size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants