feat: getMetaInfoHander tracing tracker + origin#555
feat: getMetaInfoHander tracing tracker + origin#555hweawer wants to merge 1 commit intofeat/tracing-agent-metainfofrom
Conversation
There was a problem hiding this comment.
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
getMetaInfoHandlerfunctions 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", |
There was a problem hiding this comment.
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.
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: