Rationalize OCI image fetching logging#11347
Merged
dan-stowell merged 2 commits intomasterfrom Feb 18, 2026
Merged
Conversation
ocicache.go (library layer - log at boundary, not in library): - Remove 7 Warning log lines from WriteManifestToAC and FetchManifestFromAC that were duplicated by callers in oci.go and ocifetcher.go - Remove Info log on successful manifest write (normal path, no value) - Downgrade manifest cache hit/miss from Info to Debug (metrics preserved) - Add ctx to readThroughCacher for fire-and-forget cache write warnings (these are the only place these errors are logged) oci.go (resolver - direct registry path): - Downgrade 'Authenticating with registry' from Info to Debug (every pull) - Downgrade 'Resolving image' from Info to Debug (every pull) - Add ctx to 'Error fetching blob from cache' (was missing tracing) ocifetcher.go (server-side fetcher): - Prefix all Warning messages with [ocifetcher] to disambiguate from near-identical messages in oci.go ociregistry.go (HTTP mirror/registry): - Differentiate two identical 'Error writing response body' messages ociruntime.go (layer extraction): - Add ctx to 4 filecache population log calls ociconv.go (ext4 conversion): - Add ctx to 3 Debug calls Net effect: - Info+ log lines per cached image pull: ~6 -> 1 - Double-logged errors: 5-6 sites -> 0 - Log lines missing request context: 12 -> 2 - Ambiguous duplicate messages: 5 pairs -> 0 - Cache hit/miss metrics (OCIRegistryCacheEvents) fully preserved Co-authored-by: Shelley <shelley@exe.dev>
bduffany
approved these changes
Feb 18, 2026
| // Since we do not know the state of the stream, it is not safe | ||
| // to write bytes to the stream past this point. | ||
| log.CtxWarningf(ctx, "Error fetching blob from cache: %s", err) | ||
| log.CtxWarningf(ctx, "[ocifetcher] Error fetching blob from cache: %s", err) |
Member
There was a problem hiding this comment.
not a huge fan of the square-bracket prefix because this info is already logged automatically (and accessible in a nicer way imo)
- Expand the log entry in go/logs
- Find sourceLocation > file in the JSON payload
- Click the file name > "Add field to summary line"
- If you want to always see this info, you can make a go/ link since this state is stored in the URL (in the "summaryFields" param). We could consider updating go/logs to make it always visible as well
Should look like this:
Also during local development I believe we have the short filename prefix enabled by default (or if not, I think there is a flag to turn it on)
Contributor
Author
There was a problem hiding this comment.
ack, i'll remove
dan-stowell
added a commit
that referenced
this pull request
Feb 19, 2026
This reverts commit 5856b6e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Net effect
deets
ocicache.go (library layer - log at boundary, not in library):
oci.go (resolver - direct registry path):
ociregistry.go (HTTP mirror/registry):
ociruntime.go (layer extraction):
ociconv.go (ext4 conversion):