fix(monitoring): use otel.SetLoggerProvider
schemas / check-release (pull_request) Failing after 2m45s
schemas / vulnerabilities (pull_request) Successful in 3m29s
schemas / check (pull_request) Successful in 4m5s
schemas / build (pull_request) Skipped
schemas / deploy-prod (pull_request) Skipped
pre-commit / pre-commit (pull_request) Successful in 9m44s
schemas / check-release (pull_request) Failing after 2m45s
schemas / vulnerabilities (pull_request) Successful in 3m29s
schemas / check (pull_request) Successful in 4m5s
schemas / build (pull_request) Skipped
schemas / deploy-prod (pull_request) Skipped
pre-commit / pre-commit (pull_request) Successful in 9m44s
opentelemetry-go v1.47.0 deprecates go.opentelemetry.io/otel/log/global in favour of the equivalent otel APIs; staticcheck (SA1019) fails pre-commit on every PR since the monorepo bump (#990). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ma8eHhW59hLAJuLzBnLvUu
This commit is contained in:
1 parent
c97722812f
commit
6f6fb5be68
2 files changed
+2
-3
No files matched your search
+1
-2
@@ -12,7 +12,6 @@ import (
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
|
||||
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
|
||||
"go.opentelemetry.io/otel/exporters/stdout/stdoutlog"
|
||||
"go.opentelemetry.io/otel/log/global"
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
"go.opentelemetry.io/otel/sdk/log"
|
||||
"go.opentelemetry.io/otel/sdk/metric"
|
||||
@@ -75,7 +74,7 @@ func SetupOTelSDK(ctx context.Context, enabled bool, serviceName, buildVersion,
|
||||
processor := log.NewSimpleProcessor(logExporter)
|
||||
logProvider := log.NewLoggerProvider(log.WithProcessor(processor))
|
||||
|
||||
global.SetLoggerProvider(logProvider)
|
||||
otel.SetLoggerProvider(logProvider)
|
||||
shutdownFuncs = append(shutdownFuncs, logProvider.Shutdown)
|
||||
|
||||
exp, err := otlpmetrichttp.New(ctx)
|
||||
|
||||
Reference in new issue
Block a user