Skip to content

Add instrumentation for the "go.opentelemetry.io/otel/trace".nonRecordingSpan #974

@MrAlias

Description

@MrAlias

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions