Skip to content

Commit

Permalink
fix(config): fix default booleans not being overriden by env vars (#1112
Browse files Browse the repository at this point in the history
)

* fix(config): fix default booleans not being overriden by env vars; fix otel propogation

* chore: Update Changelog
  • Loading branch information
markphelps authored Nov 1, 2022
1 parent 937047c commit b5250a4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cmd/flipt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions internal/config/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
1 change: 1 addition & 0 deletions internal/config/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
})

Expand Down
7 changes: 4 additions & 3 deletions internal/config/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
})

Expand Down

0 comments on commit b5250a4

Please sign in to comment.