1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-03-17 20:57:51 +02:00

Fix panic instruments creation when setting meter provider (#5758)

Related #5757. This is a quick fix.
This commit is contained in:
Sam Xie 2024-09-01 11:02:31 -07:00 committed by GitHub
parent e47618fc36
commit 932a4d8a5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Fixed
- Fix memory leak in the global `MeterProvider` when identical instruments are repeatedly created. (#5754)
- Fix panic instruments creation when setting meter provider. (#5758)
### Removed

View File

@ -141,7 +141,7 @@ func (m *meter) setDelegate(provider metric.MeterProvider) {
m.registry.Remove(e)
}
m.instruments = nil
clear(m.instruments)
m.registry.Init()
}