mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:37:34 +00:00
feat: enable tracing (#3528)
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"github.com/zitadel/zitadel/internal/telemetry/tracing"
|
||||
"github.com/zitadel/zitadel/internal/telemetry/tracing/otel"
|
||||
"strconv"
|
||||
|
||||
stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace"
|
||||
sdk_trace "go.opentelemetry.io/otel/sdk/trace"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/telemetry/tracing"
|
||||
"github.com/zitadel/zitadel/internal/telemetry/tracing/otel"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@@ -12,6 +16,20 @@ type Config struct {
|
||||
MetricPrefix string
|
||||
}
|
||||
|
||||
func NewTracer(rawConfig map[string]interface{}) (err error) {
|
||||
c := new(Config)
|
||||
c.MetricPrefix, _ = rawConfig["metricprefix"].(string)
|
||||
fraction, ok := rawConfig["fraction"].(string)
|
||||
if ok {
|
||||
c.Fraction, err = strconv.ParseFloat(fraction, 32)
|
||||
if err != nil {
|
||||
return errors.ThrowInternal(err, "LOG-Dsag3", "could not map fraction")
|
||||
}
|
||||
}
|
||||
|
||||
return c.NewTracer()
|
||||
}
|
||||
|
||||
type Tracer struct {
|
||||
otel.Tracer
|
||||
}
|
||||
|
Reference in New Issue
Block a user