feat: new tracing type none (#422)

This commit is contained in:
Silvan 2020-07-09 14:34:20 +02:00 committed by GitHub
parent 8efa697af2
commit 5658f33918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -61,4 +61,7 @@ export ZITADEL_SHORT_CACHE_SHARED_MAXAGE=15m
export ZITADEL_CONSOLE_ENV_DIR=../../console/src/assets/
#Org
export ZITADEL_DEFAULT_DOMAIN=zitadel.ch
export ZITADEL_DEFAULT_DOMAIN=zitadel.ch
#Tracing
export TRACING_TYPE=google

View File

@ -4,7 +4,7 @@ Log:
Format: text
Tracing:
Type: google
Type: $TRACING_TYPE
Config:
ProjectID: $ZITADEL_TRACING_PROJECT_ID
MetricPrefix: ZITADEL-V1

View File

@ -17,6 +17,8 @@ type TracingConfig struct {
var tracer = map[string]func() tracing.Config{
"google": func() tracing.Config { return &tracing_g.Config{} },
"log": func() tracing.Config { return &tracing_log.Config{} },
"none": func() tracing.Config { return &NoTracing{} },
"": func() tracing.Config { return &NoTracing{} },
}
func (c *TracingConfig) UnmarshalJSON(data []byte) error {
@ -57,3 +59,9 @@ func newTracingConfig(tracerType string, configData []byte) (tracing.Config, err
return tracingConfig, nil
}
type NoTracing struct{}
func (_ *NoTracing) NewTracer() error {
return nil
}