mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-02 17:08:51 +00:00
add tracing and refactor some api pkgs
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user