Memory leak caused by otelhttp
when no Meter Provider is configured.
#5190
Labels
area: instrumentation
Related to an instrumentation package
bug
Something isn't working
instrumentation: otelhttp
Description
When calling
otelhttp.NewTransport()
multiple times, memory is leaked.Supposedly this was resolved by open-telemetry/opentelemetry-go#4820 but I do not think this fixes the issue when no meter provider has been configured and the default global delegating meter provider is in place.
Related: #4226
Introduced by: #4707
Environment
Steps To Reproduce
Run each of these with
test.memprofile
and analyze the inuse heap objects/space difference between them.Alternatively, write an application which calls
otelhttp.NewTransport
and analyze heap usage.Expected behavior
Calling otelhttp.NewTransport() repeatedly doesn't leak memory
Workaround
Call
otel.SetMeterProvider(noop.MeterProvider{})
at the start of your application.The text was updated successfully, but these errors were encountered: