Skip to content

ref(flags): rewrite span flag tracking to not use global map #16651

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

Closed
wants to merge 1 commit into from

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Jun 18, 2025

Follow up on #16485 (review)

Instead of tracking the evaluated feature flags in a global weakmap, we can directly check the span attributes by converting to JSON.

@aliu39 aliu39 marked this pull request as ready for review June 18, 2025 21:58
@aliu39 aliu39 requested review from chargome, a team and AbhiPrasad and removed request for a team June 18, 2025 21:58
@aliu39
Copy link
Member Author

aliu39 commented Jun 18, 2025

@chargome I'm curious if the team has concerns on performance? If a customer is repeatedly evaluating 100s of flags and calling addFeatureFlag each time, should we worry about spanToJSON being too expensive?

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We previously did have some issues with spanToJSON - but the performance should be much better now.

Might be nice to benchmark - you can probably test server-side with profiling a node app: https://nodejs.org/en/learn/getting-started/profiling

@aliu39
Copy link
Member Author

aliu39 commented Jun 18, 2025

Talked with @AbhiPrasad , closing for now until I get more bandwidth to play with benchmarking experiments. The map implementation should be fine for releasing

@aliu39 aliu39 closed this Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants