Skip to content

Commit

Permalink
fix: only register otel during initialization (#1736)
Browse files Browse the repository at this point in the history
* fix: only register otel during initialization

Signed-off-by: Michael Beemer <[email protected]>

* revert removal of fatal log

---------

Signed-off-by: Michael Beemer <[email protected]>
Co-authored-by: Juliano Costa <[email protected]>
  • Loading branch information
beeme1mr and julianocosta89 authored Oct 14, 2024
1 parent 0e48b4b commit 026e3ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/productcatalogservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func main() {
}
log.Println("Shutdown meter provider")
}()
openfeature.AddHooks(otelhooks.NewTracesHook())
err := openfeature.SetProvider(flagd.NewProvider())
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -300,7 +301,7 @@ func (p *productCatalog) checkProductFailure(ctx context.Context, id string) boo
if id != "OLJCESPC7Z" {
return false
}
openfeature.AddHooks(otelhooks.NewTracesHook())

client := openfeature.NewClient("productCatalog")
failureEnabled, _ := client.BooleanValue(
ctx, "productCatalogFailure", false, openfeature.EvaluationContext{},
Expand Down

0 comments on commit 026e3ba

Please sign in to comment.