Upgraded DataDog tracing library to 1.14.0
This commit is contained in:
parent
1f2fe08c33
commit
adc2b62c22
13 changed files with 485 additions and 60 deletions
28
vendor/gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig/globalconfig.go
generated
vendored
Normal file
28
vendor/gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig/globalconfig.go
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Package globalconfig stores configuration which applies globally to both the tracer
|
||||
// and integrations.
|
||||
package globalconfig
|
||||
|
||||
import "sync"
|
||||
|
||||
var cfg = &config{}
|
||||
|
||||
type config struct {
|
||||
mu sync.RWMutex
|
||||
analyticsRate float64
|
||||
}
|
||||
|
||||
// AnalyticsRate returns the sampling rate at which events should be marked. It uses
|
||||
// synchronizing mechanisms, meaning that for optimal performance it's best to read it
|
||||
// once and store it.
|
||||
func AnalyticsRate() float64 {
|
||||
cfg.mu.RLock()
|
||||
defer cfg.mu.RUnlock()
|
||||
return cfg.analyticsRate
|
||||
}
|
||||
|
||||
// SetAnalyticsRate sets the given event sampling rate globally.
|
||||
func SetAnalyticsRate(rate float64) {
|
||||
cfg.mu.Lock()
|
||||
cfg.analyticsRate = rate
|
||||
cfg.mu.Unlock()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue