Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MrAlias opened this issue Jul 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Jul 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant