Skip to content

Conversation

@hweawer
Copy link
Collaborator

@hweawer hweawer commented Jan 28, 2026

This PR adds context support to the PrefetchBlob method across the origin blob client infrastructure, enabling proper distributed tracing and request cancellation for blob prefetching operations.

Changes:

Updated PrefetchBlob interface signatures to accept context.Context as the first parameter
Added comprehensive OpenTelemetry tracing instrumentation to prefetch operations
Updated all call sites and tests to pass context appropriately

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds context support to the PrefetchBlob method across the origin blob client infrastructure, enabling proper distributed tracing and request cancellation for blob prefetching operations.

Changes:

  • Updated PrefetchBlob interface signatures to accept context.Context as the first parameter
  • Added comprehensive OpenTelemetry tracing instrumentation to prefetch operations
  • Updated all call sites and tests to pass context appropriately

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
origin/blobclient/client.go Updated Client interface and HTTPClient.PrefetchBlob implementation to accept context, added tracing spans and context propagation
origin/blobclient/cluster_client.go Updated ClusterClient interface and clusterClient.PrefetchBlob implementation to accept context, added comprehensive tracing and error handling
proxy/proxyserver/prefetch.go Removed obsolete comment about context not being supported, updated call to pass context
proxy/proxyserver/server_test.go Updated mock expectations to include gomock.Any() for context parameter
origin/blobserver/server_test.go Updated test to pass context.Background() when calling PrefetchBlob
mocks/origin/blobclient/client.go Regenerated mock to reflect updated Client interface signature
mocks/origin/blobclient/clusterclient.go Regenerated mock to reflect updated ClusterClient interface signature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +282 to +289
ctx, span := otel.Tracer("kraken-origin-cluster").Start(ctx, "cluster.prefetch_blob",
trace.WithSpanKind(trace.SpanKindClient),
trace.WithAttributes(
attribute.String("component", "origin-cluster-client"),
attribute.String("namespace", namespace),
attribute.String("blob.digest", d.Hex()),
),
)
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The span attributes are missing the "operation" attribute that is present in other similar methods (UploadBlob and DownloadBlob) in this file. For consistency with the established tracing pattern in this codebase, consider adding attribute.String("operation", "prefetch_blob") to the attributes list.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants