Skip to content

Tracing putTag#535

Merged
hweawer merged 2 commits intomasterfrom
feat/put-tag-server-side-tracing
Feb 4, 2026
Merged

Tracing putTag#535
hweawer merged 2 commits intomasterfrom
feat/put-tag-server-side-tracing

Conversation

@hweawer
Copy link
Collaborator

@hweawer hweawer commented Jan 18, 2026

This pull request adds OpenTelemetry distributed tracing support to the build-index tag server's putTag operation. The changes enable tracing of Docker push operations through the system, making it easier to debug and monitor performance.

  1. Request Entry Point (Build-Index Server)
  • otelhttp.NewMiddleware automatically creates the root span from incoming HTTP request
  • Extracts trace context from headers if present (for distributed traces), or generates new Trace ID
  • Span name: HTTP-level (e.g., PUT /tags/:tag)
  1. Business Logic Span (putTagHandler)
  • Creates child span: build_index.put_tag
  • Custom attributes added:
    • tag: The Docker image tag
    • digest: The blob digest (sha256:...)
    • replicate: Whether replication was requested
    • dependency_count: Number of dependencies (layers + manifest)
    • success: Final operation status

Copilot AI review requested due to automatic review settings January 18, 2026 21:39
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 pull request adds OpenTelemetry distributed tracing support to the build-index tag server's putTag operation. The changes enable tracing of Docker push operations through the system, making it easier to debug and monitor performance.

Changes:

  • Adds a new WithTraceContext logging utility function that extracts trace_id and span_id from context
  • Implements OpenTelemetry tracing in the putTagHandler with span lifecycle management and error recording
  • Updates dependencies to include OpenTelemetry packages (v1.21.0 for core, v0.46.0 for HTTP instrumentation)

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
utils/log/log.go Adds WithTraceContext helper function to include trace_id and span_id in logs
build-index/tagserver/server.go Adds tracer field to Server struct, applies tracing middleware to PUT endpoint, implements span management in putTagHandler with attributes and error recording
build-index/cmd/cmd.go Initializes OpenTelemetry tracer and passes it to the server
build-index/tagserver/server_test.go Updates test setup to use noop tracer for compatibility
go.mod Adds OpenTelemetry dependencies and upgrades testify to v1.8.4
go.sum Updates checksums for new and upgraded dependencies

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

@hweawer hweawer self-assigned this Jan 26, 2026
@hweawer hweawer merged commit 6dc6a4b into master Feb 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants