mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 01:02:29 +00:00
fix(otel)!: do not use a global client
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -10,11 +10,14 @@ import (
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
|
||||
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
|
||||
"go.opentelemetry.io/otel/sdk/metric/metricdata"
|
||||
|
||||
"go.linka.cloud/grpc-toolkit/logger"
|
||||
)
|
||||
|
||||
func configureMetrics(ctx context.Context, conf *config) *sdkmetric.MeterProvider {
|
||||
log := logger.C(ctx)
|
||||
opts := conf.metricOptions
|
||||
if res := conf.newResource(); res != nil {
|
||||
if res := conf.newResource(ctx); res != nil {
|
||||
opts = append(opts, sdkmetric.WithResource(res))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user