Skip to content

Commit

Permalink
Create feature flag for otlp tracers (#19)
Browse files Browse the repository at this point in the history
* Enable feature flag for otlp tracers

* Fix missing flag on test
  • Loading branch information
lmsilva-wls authored Dec 5, 2022
1 parent 8468aff commit bfc70e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ func NewApp(host string, port int, log logger.Logger, config *viper.Viper) (*App
}

func (a *App) loadConfigurationDefaults() {
a.config.SetDefault("jaeger.disabled", true)
a.config.SetDefault("jaeger.samplingProbability", 0.1)
a.config.SetDefault("jaeger.serviceName", "events-gateway")
a.config.SetDefault("otlp.enabled", false)
a.config.SetDefault("kafka.producer.net.maxOpenRequests", 10)
a.config.SetDefault("kafka.producer.net.dialTimeout", "500ms")
a.config.SetDefault("kafka.producer.net.readTimeout", "250ms")
Expand All @@ -100,9 +98,13 @@ func (a *App) loadConfigurationDefaults() {

func (a *App) configure() error {
a.loadConfigurationDefaults()
if err := a.configureOTel(); err != nil {
return err

if a.config.GetBool("otlp.enabled") {
if err := a.configureOTel(); err != nil {
return err
}
}

err := a.configureEventsForwarder()
if err != nil {
return err
Expand Down
4 changes: 4 additions & 0 deletions client/sync_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ var _ = Describe("Sync Client", func() {

kafkaTopic = fmt.Sprintf("test-%s", uuid.New().String())
config.Set("client.kafkatopic", kafkaTopic)

config.Set("otlp.enabled", true)
})

AfterEach(func() {
Expand All @@ -49,6 +51,8 @@ var _ = Describe("Sync Client", func() {
if a != nil {
a.Stop()
}

config.Set("otlp.enabled", false)
})

startAppAndClient := func() {
Expand Down

0 comments on commit bfc70e6

Please sign in to comment.