feat: Tracing agent -> tracker -> origin#554
Open
hweawer wants to merge 2 commits intofeat/tracing-origin-server-download-prefetchfrom
Open
feat: Tracing agent -> tracker -> origin#554hweawer wants to merge 2 commits intofeat/tracing-origin-server-download-prefetchfrom
hweawer wants to merge 2 commits intofeat/tracing-origin-server-download-prefetchfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds distributed tracing support for the metainfo retrieval path from agent through tracker to origin, enabling end-to-end observability of blob metadata requests.
Changes:
- Added context parameter to
GetMetaInfoandDownloadmethods throughout the codebase to enable trace context propagation - Implemented OpenTelemetry tracing spans in origin cluster client, origin client, and agent storage components
- Added trace header propagation in tracker nginx configuration
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tracker/trackerserver/server.go | Minor formatting improvement to function signature |
| tracker/trackerserver/metainfo_test.go | Updated test to pass context and use gomock.Any() for context parameter matching |
| tracker/trackerserver/metainfo.go | Modified to pass request context to origin cluster GetMetaInfo call |
| tracker/metainfoclient/testing.go | Updated TestClient interface to accept context parameter |
| tracker/metainfoclient/client.go | Added context parameter to Download method and implemented trace context propagation |
| proxy/proxyserver/server_test.go | Updated mock expectations to include context parameter |
| proxy/proxyserver/preheat.go | Added context.Background() to GetMetaInfo calls |
| origin/blobserver/server_test.go | Updated test calls to include context.Background() |
| origin/blobserver/cluster_client_test.go | Updated test calls and mock expectations for context parameter |
| origin/blobclient/cluster_client.go | Added OpenTelemetry tracing implementation with span creation, error recording, and status tracking |
| origin/blobclient/client.go | Added OpenTelemetry tracing implementation for GetMetaInfo method |
| nginx/config/tracker.go | Added proxy headers for trace context propagation (traceparent, tracestate, jaeger-debug-id) |
| mocks/tracker/metainfoclient/client.go | Updated mock to reflect new interface signature with context |
| mocks/origin/blobclient/clusterclient.go | Updated mock to reflect new interface signature with context |
| mocks/origin/blobclient/client.go | Updated mock to reflect new interface signature with context |
| lib/torrent/storage/agentstorage/torrent_archive_test.go | Updated test expectations to include gomock.Any() for context |
| lib/torrent/storage/agentstorage/torrent_archive.go | Added tracing implementation and context propagation from agent storage |
| lib/torrent/scheduler/scheduler_test.go | Updated all test expectations to include gomock.Any() for context |
| lib/torrent/scheduler/events_test.go | Updated test expectation to include gomock.Any() for context |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Anton-Kalpakchiev
approved these changes
Feb 2, 2026
| ctx, span := otel.Tracer("kraken-origin-cluster").Start(ctx, "cluster.get_metainfo", | ||
| trace.WithSpanKind(trace.SpanKindClient), | ||
| trace.WithAttributes( | ||
| attribute.String("component", "origin-cluster-client"), |
Collaborator
There was a problem hiding this comment.
Can we extract the component string to the top of the file in a constant to ensure we are always consistent when using it? Asking for the single origin client too.
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.
This PR adds distributed tracing support for the metainfo retrieval path from agent through tracker to origin, enabling end-to-end observability of blob metadata requests.
Changes: