Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Fixes

- Stop percent encoding header environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6392)
- Ensure the `noopSpan.tracerProvider` method is not inlined in `go.opentelemetry.io/otel/trace` so the `go.opentelemetry.io/auto` instrumentation can instrument non-recording spans. (#6456)

<!-- Released section -->
<!-- Don't change this section unless doing release -->
Expand Down
8 changes: 8 additions & 0 deletions internal/global/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ func (t *tracer) Start(ctx context.Context, name string, opts ...trace.SpanStart
// a nonRecordingSpan by default.
var autoInstEnabled = new(bool)

// newSpan is called by tracer.Start so auto-instrumentation can attach an eBPF
// uprobe to this code.
//
// Strictly speaking, the following "noinline" flag is not needed, the method's
// complexity prevents it being inlined. This ensure that is the case going
// forward by making the restriction explicit.
//
//go:noinline
func (t *tracer) newSpan(ctx context.Context, autoSpan *bool, name string, opts []trace.SpanStartOption) (context.Context, trace.Span) {
// autoInstEnabled is passed to newSpan via the autoSpan parameter. This is
// so the auto-instrumentation can define a uprobe for (*t).newSpan and be
Expand Down
2 changes: 2 additions & 0 deletions trace/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ var autoInstEnabled = new(bool)
// tracerProvider return a noopTracerProvider if autoEnabled is false,
// otherwise it will return a TracerProvider from the sdk package used in
// auto-instrumentation.
//
//go:noinline
func (noopSpan) tracerProvider(autoEnabled *bool) TracerProvider {
if *autoEnabled {
return newAutoTracerProvider()
Expand Down
Loading