Skip to content

feat: getMetaInfoHander tracing tracker + origin#555

Open
hweawer wants to merge 1 commit intofeat/tracing-agent-metainfofrom
feat/tracing-metainfo-handlers
Open

feat: getMetaInfoHander tracing tracker + origin#555
hweawer wants to merge 1 commit intofeat/tracing-agent-metainfofrom
feat/tracing-metainfo-handlers

Conversation

@hweawer
Copy link
Copy Markdown
Collaborator

@hweawer hweawer commented Jan 29, 2026

This PR adds OpenTelemetry distributed tracing to the getMetaInfoHandler in both the tracker and origin servers. The changes enhance observability by instrumenting the metainfo retrieval flow with spans, error tracking, and trace context propagation in logs.

Changes:

  • Added tracing middleware to the metainfo endpoints in both tracker and origin servers
  • Instrumented getMetaInfoHandler functions with OpenTelemetry spans including error handling and status codes
  • Updated logging calls to use log.WithTraceContext(ctx) for trace-aware logging

@hweawer hweawer self-assigned this Jan 29, 2026
@hweawer hweawer changed the title feat: Tracing agent -> tracker -> origin feat: getMetaInfoHander tracing tracker + origin Jan 29, 2026
@hweawer hweawer requested a review from Copilot January 29, 2026 17:39
Copy link
Copy Markdown
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 OpenTelemetry distributed tracing to the getMetaInfoHandler in both the tracker and origin servers. The changes enhance observability by instrumenting the metainfo retrieval flow with spans, error tracking, and trace context propagation in logs.

Changes:

  • Added tracing middleware to the metainfo endpoints in both tracker and origin servers
  • Instrumented getMetaInfoHandler functions with OpenTelemetry spans including error handling and status codes
  • Updated logging calls to use log.WithTraceContext(ctx) for trace-aware logging

Reviewed changes

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

File Description
tracker/trackerserver/server.go Added OpenTelemetry imports and applied tracing middleware to the metainfo endpoint
tracker/trackerserver/metainfo.go Added span creation, error recording, and trace context to logging for the getMetaInfoHandler
origin/blobserver/server.go Applied tracing middleware to the internal metainfo endpoint and instrumented getMetaInfoHandler with spans and trace-aware logging

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

)

func (s *Server) getMetaInfoHandler(w http.ResponseWriter, r *http.Request) error {
ctx, span := otel.Tracer("kraken-tracker").Start(r.Context(), "tracker.get_metainfo",
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 tracker is creating a tracer inline with otel.Tracer("kraken-tracker") while the origin server uses s.tracer which is initialized in the server constructor. For consistency with the rest of the codebase (see origin/blobserver/server.go:123, build-index/tagserver/server.go, and other examples), the tracker server should also initialize a tracer field in its constructor and use s.tracer.Start() here instead of calling otel.Tracer() inline.

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.

3 participants