-
Notifications
You must be signed in to change notification settings - Fork 464
feat: Tracing agent -> tracker -> origin #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/tracing-origin-server-download-prefetch
Are you sure you want to change the base?
feat: Tracing agent -> tracker -> origin #554
Conversation
There was a problem hiding this 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 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.
| ctx, span := otel.Tracer("kraken-origin-cluster").Start(ctx, "cluster.get_metainfo", | ||
| trace.WithSpanKind(trace.SpanKindClient), | ||
| trace.WithAttributes( | ||
| attribute.String("component", "origin-cluster-client"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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: