You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
9bf6470d8e
This PR changes `DefaultExemplarReservoirProviderSelector` in `go.opentelemetry.io/otel/sdk/metric` to use `runtime.GOMAXPROCS(0)` instead of `runtime.NumCPU()` for the `FixedSizeReservoirProvider` default size. **Motivation** The [runtime.NumCPU](https://pkg.go.dev/runtime#NumCPU) returns the number of logical CPUs usable by the current process. In Kubernetes, the method will return the total number of cores on the node, not the actual number of cores available to the container. Since it is common practice to allocate only a small fraction of the total CPU on a node to a container, the current implementation may result in an excessive `FixedSizeReservoir` size, which in turn negatively impacts the resources consumed. --------- Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> Co-authored-by: Tyler Yahn <codingalias@gmail.com>