1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

Use auto-instrumentation SDK in global tracing (#5920)

When the auto-instrumentation attaches to a process using the global
TracerProvider, and there has not been a delegate set, create a span
from the go.opentelemetry.io/auto/sdk package so the OTel Go
auto-instrumentation can instrument the application by default.

Resolve #5702

### Benchmarks

```terminal
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/otel/internal/global
cpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
                    │   old.txt    │            new.txt             │
                    │    sec/op    │    sec/op     vs base          │
StartEndSpanNoSDK-8   244.2n ± 21%   250.2n ± 23%  ~ (p=0.739 n=10)
```
This commit is contained in:
Tyler Yahn
2024-11-21 10:54:58 -08:00
committed by GitHub
parent b99d2b8178
commit 99c3c661e0
49 changed files with 237 additions and 56 deletions
+3 -1
View File
@@ -1,18 +1,20 @@
module go.opentelemetry.io/otel
go 1.22
go 1.22.0
require (
github.com/go-logr/logr v1.4.2
github.com/go-logr/stdr v1.2.2
github.com/google/go-cmp v0.6.0
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/auto/sdk v1.0.0
go.opentelemetry.io/otel/metric v1.32.0
go.opentelemetry.io/otel/trace v1.32.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)