diff --git a/CHANGELOG.md b/CHANGELOG.md index 045345bfc7..b28299e357 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Deprecated both `db.migrations.path` and `db.migrations_path` [#1096](https://github.com/flipt-io/flipt/pull/1096) +### Fixed + +- Propogating OpenTelemetry spans through Flipt [#1112](https://github.com/flipt-io/flipt/pull/1112) + ## [v1.13.0](https://github.com/markphelps/flipt/releases/tag/v1.13.0) - 2022-10-17 ### Added diff --git a/cmd/flipt/main.go b/cmd/flipt/main.go index 69164a17df..fadbb804e3 100644 --- a/cmd/flipt/main.go +++ b/cmd/flipt/main.go @@ -49,6 +49,7 @@ import ( "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/exporters/jaeger" + "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/resource" tracesdk "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" @@ -462,7 +463,7 @@ func run(ctx context.Context, logger *zap.Logger) error { } otel.SetTracerProvider(tracingProvider) - + otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})) { // forward internal gRPC logging to zap grpcLogLevel, err := zapcore.ParseLevel(cfg.Log.GRPCLevel) diff --git a/internal/config/cache.go b/internal/config/cache.go index fd735ae76d..534f2e9582 100644 --- a/internal/config/cache.go +++ b/internal/config/cache.go @@ -21,6 +21,7 @@ type CacheConfig struct { func (c *CacheConfig) setDefaults(v *viper.Viper) (warnings []string) { v.SetDefault("cache", map[string]any{ + "enabled": false, "backend": CacheMemory, "ttl": 1 * time.Minute, "redis": map[string]any{ diff --git a/internal/config/cors.go b/internal/config/cors.go index c515e79777..e30bc95295 100644 --- a/internal/config/cors.go +++ b/internal/config/cors.go @@ -14,6 +14,7 @@ type CorsConfig struct { func (c *CorsConfig) setDefaults(v *viper.Viper) []string { v.SetDefault("cors", map[string]any{ + "enabled": false, "allowed_origins": "*", }) diff --git a/internal/config/tracing.go b/internal/config/tracing.go index 16204e75b2..76b7f52ca4 100644 --- a/internal/config/tracing.go +++ b/internal/config/tracing.go @@ -16,14 +16,15 @@ type JaegerTracingConfig struct { // TracingConfig contains fields, which configure tracing telemetry // output destinations. type TracingConfig struct { - Jaeger JaegerTracingConfig `json:"jaeger,omitempty"` + Jaeger JaegerTracingConfig `json:"jaeger,omitempty" mapstructure:"jaeger"` } func (c *TracingConfig) setDefaults(v *viper.Viper) []string { v.SetDefault("tracing", map[string]any{ "jaeger": map[string]any{ - "host": "localhost", - "port": 6831, + "enabled": false, + "host": "localhost", + "port": 6831, }, })