Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[featureflag] productCatalogFailure flag raising 128 events #1735

Closed
julianocosta89 opened this issue Oct 7, 2024 · 3 comments · Fixed by #1736
Closed

[featureflag] productCatalogFailure flag raising 128 events #1735

julianocosta89 opened this issue Oct 7, 2024 · 3 comments · Fixed by #1736
Labels
bug Something isn't working

Comments

@julianocosta89
Copy link
Member

Bug Report

Which version of the demo you are using?
Main (a1cfe47)

Symptom

When enabling the feature flag productCatalogFailure, the spans from productCatalog service are emitting 128 events.
image

What is the expected behavior?

The feature flag should be checked only once.

What is the actual behavior?

The feature flag is checked 127 times.

Reproduce

Could you provide the minimum required steps to resolve the issue you're seeing?

  • pull main
  • run make start
  • enable productCatalogFailurefeature flag
  • navigate to jaeger and check any span with error from the productCatalogService.
@julianocosta89 julianocosta89 added the bug Something isn't working label Oct 7, 2024
@julianocosta89
Copy link
Member Author

@beeme1mr would you be able to take a look at this?

I've quickly checked the productCatalogService and the implementation seems about right:
https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/productcatalogservice/main.go#L253-L257

I couldn't find a place where we would set 127 span events in the productCatalogService, maybe I've missed something.

LMK if you want me to move this issue to the flagd repo.

@beeme1mr
Copy link
Contributor

beeme1mr commented Oct 7, 2024

It looks like a new OTel hook is registered globally for every request, which is very likely the root cause. Either it should be done once during initialization, or the hook should be set at the client level.

https://github.com/open-telemetry/opentelemetry-demo/blob/main/src/productcatalogservice/main.go#L303

@julianocosta89
Copy link
Member Author

Thank you @beeme1mr! 🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants