You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-08-10 22:31:50 +02:00
Remove the deprecated otel/metric/global
pkg (#3829)
* Remove the deprecated `otel/metric/global` pkg * Add changelog entry * Update PR number in changelog * Fix lint --------- Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
This commit is contained in:
10
metric.go
10
metric.go
@@ -15,10 +15,8 @@
|
||||
package otel // import "go.opentelemetry.io/otel"
|
||||
|
||||
import (
|
||||
"go.opentelemetry.io/otel/internal/global"
|
||||
"go.opentelemetry.io/otel/metric"
|
||||
// TODO (#3819): Remove this disablement.
|
||||
// nolint: staticcheck // Temporary, while metric/global is deprecated.
|
||||
"go.opentelemetry.io/otel/metric/global"
|
||||
)
|
||||
|
||||
// Meter returns a Meter from the global MeterProvider. The name must be the
|
||||
@@ -35,8 +33,6 @@ import (
|
||||
//
|
||||
// This is short for GetMeterProvider().Meter(name).
|
||||
func Meter(name string, opts ...metric.MeterOption) metric.Meter {
|
||||
// TODO (#3819): Remove this disablement.
|
||||
// nolint: staticcheck // Temporary, while metric/global is deprecated.
|
||||
return GetMeterProvider().Meter(name, opts...)
|
||||
}
|
||||
|
||||
@@ -48,14 +44,10 @@ func Meter(name string, opts ...metric.MeterOption) metric.Meter {
|
||||
// created or will create, are recreated automatically from the new
|
||||
// GetMeterProvider.
|
||||
func GetMeterProvider() metric.MeterProvider {
|
||||
// TODO (#3819): Remove this disablement.
|
||||
// nolint: staticcheck // Temporary, while metric/global is deprecated.
|
||||
return global.MeterProvider()
|
||||
}
|
||||
|
||||
// SetMeterProvider registers mp as the global MeterProvider.
|
||||
func SetMeterProvider(mp metric.MeterProvider) {
|
||||
// TODO (#3819): Remove this disablement.
|
||||
// nolint: staticcheck // Temporary, while metric/global is deprecated.
|
||||
global.SetMeterProvider(mp)
|
||||
}
|
||||
|
Reference in New Issue
Block a user