1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-12-05 23:28:07 +02:00
Commit Graph

2 Commits

Author SHA1 Message Date
Flc゛
80cb909774 refactor: replace context.Background() with t.Context()/b.Context() in tests (#7352)
Based on the Go version we currently use, the dependency already
supports 1.24+, which allows using `t.Context()` and `b.Context()` in
unit tests and benchmarks respectively.

- Enable `context-background` and `context-todo` in
[`usetesting`](https://golangci-lint.run/docs/linters/configuration/#usetesting)
- Adjust the code to support linter detection

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
2025-09-23 09:52:45 +02:00
Tyler Yahn
e4ab314112 Encapsulate SDK BatchSpanProcessor observability (#7332)
Split from #7316 

[Follow
guidelines](a5dcd68ebb/CONTRIBUTING.md (encapsulation))
and move instrumentation into its own type.

### Benchmarks

#### Added `sdk/trace/internal/observ` benchmarks

```
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/otel/sdk/trace/internal/observ
cpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
                         │ enc-trace-sdk-bsp-obs.out │
                         │          sec/op           │
BSP/Processed-8                        0.6394n ±  2%
BSP/ProcessedQueueFull-8               0.6806n ±  3%
BSP/Callback-8                          3.591µ ± 12%
geomean                                 11.60n

                         │ enc-trace-sdk-bsp-obs.out │
                         │           B/op            │
BSP/Processed-8                         0.000 ± 0%
BSP/ProcessedQueueFull-8                0.000 ± 0%
BSP/Callback-8                        2.626Ki ± 0%
geomean                                            ¹
¹ summaries must be >0 to compute geomean

                         │ enc-trace-sdk-bsp-obs.out │
                         │         allocs/op         │
BSP/Processed-8                         0.000 ± 0%
BSP/ProcessedQueueFull-8                0.000 ± 0%
BSP/Callback-8                          16.00 ± 0%
geomean                                            ¹
¹ summaries must be >0 to compute geomean
```

#### Existing `sdk/trace` benchmarks

None
2025-09-15 11:18:19 -07:00