A common instrumentation pattern for tracing is to return the the TracerProvider from the span held in a context:
import (
"net/http"
"go.opentelemetry.io/otel/trace"
)
func handler(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
tracer := trace.SpanFromContext(ctx).TracerProvider().Tracer("tracer")
ctx, span := tracer.Start(ctx, "span")
defer span.End()
/* ... */
}
When using the instrumentation of the global trace API, this span will not be recorded.
Describe the solution you'd like
The span created in this above code should be captured by auto-instrumentation. Meaning the nonRecordingSpan should be instrumented.