Skip to content

Commit

Permalink
feat: set OTEL global providers
Browse files Browse the repository at this point in the history
  • Loading branch information
adigiorgi-clickup committed May 16, 2024
1 parent f01fb8f commit 33adc3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions state/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package state

import (
"sync"

"go.opentelemetry.io/otel"
)

var (
Expand Down Expand Up @@ -29,6 +31,8 @@ func GlobalState() OTEL {
func SetGlobalState(s *OTELState) {
otelStateMutex.Lock()
otelState = s
otel.SetMeterProvider(s.MeterProvider())
otel.SetTracerProvider(s.TracerProvider())
otelStateMutex.Unlock()
}

Expand Down

0 comments on commit 33adc3d

Please sign in to comment.