Repository navigation
cri: add tracing spans for image pull and sandbox setup paths - #12628
Conversation
5162319 to
62fd9bd
Compare
mikebrow
left a comment
There was a problem hiding this comment.
we already have spans coving the CRI calls.. could you explain what is broken?
bda8715 to
6470d11
Compare
6470d11 to
e1b6f6b
Compare
92faec9 to
95bc7a9
Compare
19f213b to
985ef17
Compare
e3022ed to
31b6c7c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
client/pull.go:204
- Tracing attribute names are expected to be lower-case and dot-separated (see docs/tracing.md attribute naming conventions).
target.mediaTypeuses camelCase and will make querying/aggregation inconsistent with other attributes likedescriptor.media.type.
tracing.Attribute("target.mediaType", desc.MediaType),
31b6c7c to
6c8b36d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
client/pull.go:206
- Attribute keys here diverge from the repo’s tracing conventions and existing image-pull spans: (1)
target.mediaTypeuses camelCase butdocs/tracing.mdspecifies lower-case, dot-separated attribute names; (2) for image-pull paths this repo consistently usesimage.ref(e.g.client/pull.go:79,internal/cri/server/images/image_pull.go:173-176), socontainer.image.refis misleading in this context.
tracing.Attribute("container.image.ref", ref),
tracing.Attribute("image.name", name),
tracing.Attribute("target.mediaType", desc.MediaType),
tracing.Attribute("image.digest", desc.Digest.String()),
)
6c8b36d to
b2fce6c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
client/pull.go:290
target.mediaType/image.digestare set beforeconverterFuncruns. WhenisConvertibleis true,desccan change, so these attributes may end up reflecting the pre-conversion descriptor. Consider re-setting them after a successful conversion so the span reflects the final target.
if isConvertible {
convertCtx, convertSpan := tracing.StartSpan(ctx, tracing.Name(pullSpanPrefix, "convert_manifest"))
desc, err = converterFunc(convertCtx, desc)
convertSpan.SetStatus(err)
convertSpan.End()
client/pull.go:206
- The attribute key
image.nameis inconsistent with other client tracing attributes (e.g.,container.image.refin this function andclient/client.go). Using thecontainer.image.*namespace (and OTel semantic conventions) will make traces easier to query consistently.
span.SetAttributes(
tracing.Attribute("container.image.ref", ref),
tracing.Attribute("image.name", name),
tracing.Attribute("target.mediaType", desc.MediaType),
tracing.Attribute("image.digest", desc.Digest.String()),
)
|
Hi @mikebrow — thanks for the update on Aug 3. CI is now green. Is there anything else you’d like me to address before this is ready for approval or merge? |
Signed-off-by: Cindy Li <[email protected]>
b2fce6c to
0d8883b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
client/pull.go:206
- In this image-pull tracing span, the attribute key uses
container.image.ref, but other image-focused tracing in this codebase usesimage.ref(e.g., CRI image pull). Usingcontainer.*here makes cross-span queries inconsistent and suggests container semantics rather than image semantics.
tracing.Attribute("container.image.ref", ref),
tracing.Attribute("image.name", name),
tracing.Attribute("target.mediaType", desc.MediaType),
tracing.Attribute("image.digest", desc.Digest.String()),
This PR adds opt-in tracing spans/attributes in CRI image pull and selected sandbox-related paths to improve debugging and correlation (e.g., sandbox.id/pod metadata). If maintainers prefer a smaller diff, I’m happy to split this into a pull-only PR plus follow-ups.
Signed-off-by: Cindy Li [email protected]