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

Weights now uses trace_id to pick a choice #44

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

paivagustavo
Copy link
Contributor

@paivagustavo paivagustavo commented Mar 3, 2023

What is the current behavior?

Weights generates a random float for every we need to decide which element to pick.

What is the new behavior?

Weights now uses the last digits from trace_id to generate its weight when making a decision. This means that two different decisions that have the same weight, will happen at the same time.

Additionally, errors are propagated to parent spans.


Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests(make test) for the changes have been added (for bug fixes / features) and pass
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Lint (make lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Does this introduce a breaking change?

  • Yes
  • No

Weights will now always be deterministic within their trace_id. This means that two distinct elements tagSets vs resourceAttrSets will be consistently chose two if they have the same weights.

Copy link
Collaborator

@carolynblumberg carolynblumberg left a comment

Choose a reason for hiding this comment

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

💨

@paivagustavo paivagustavo merged commit ad46b63 into main Mar 3, 2023
@paivagustavo paivagustavo deleted the gustavo/make_weights_consistent_with_trace_id branch March 3, 2023 21:43
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