zitadel/internal/tracing/log/config.go

22 lines
305 B
Go
Raw Normal View History

2020-03-24 13:15:01 +00:00
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()
}