mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 20:08:02 +00:00
22 lines
305 B
Go
22 lines
305 B
Go
|
package log
|
||
|
|
||
|
import (
|
||
|
"go.opencensus.io/trace"
|
||
|
|
||
|
"github.com/caos/zitadel/internal/tracing"
|
||
|
)
|
||
|
|
||
|
type Config struct {
|
||
|
Fraction float64
|
||
|
}
|
||
|
|
||
|
func (c *Config) NewTracer() error {
|
||
|
if c.Fraction < 1 {
|
||
|
c.Fraction = 1
|
||
|
}
|
||
|
|
||
|
tracing.T = &Tracer{trace.ProbabilitySampler(c.Fraction)}
|
||
|
|
||
|
return tracing.T.Start()
|
||
|
}
|