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

Disable "taking" from reservoir if there is no capacity, regardless of borrow value #3684

Merged
merged 4 commits into from
Apr 8, 2023

Conversation

jj22ee
Copy link
Contributor

@jj22ee jj22ee commented Apr 7, 2023

When borrow=true, the Golang remote sampler allows a quota of 1req/s. However, this also applies when capacity is 0 (which implies that quota should always be 0, as quota is a portion of capacity). For context, borrow=true when quota is unknown but will be determined later.

This fix makes sure that the sampler cannot "take" when capacity is 0, which will also disable "borrowing". That is, when capacity is 0, do not take from reservoir at all, regardless of borrow = true/false.

@jj22ee jj22ee requested a review from a team April 7, 2023 00:38
@jj22ee jj22ee requested a review from Aneurysm9 as a code owner April 7, 2023 00:38
Copy link

@srprash srprash left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Merging #3684 (f8c359e) into main (ad0aa62) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3684   +/-   ##
=====================================
  Coverage   70.0%   70.0%           
=====================================
  Files        147     147           
  Lines       6963    6966    +3     
=====================================
+ Hits        4877    4880    +3     
  Misses      1961    1961           
  Partials     125     125           
Impacted Files Coverage Δ
samplers/aws/xray/internal/reservoir.go 100.0% <100.0%> (ø)

@MrAlias MrAlias merged commit 5f7e6ad into open-telemetry:main Apr 8, 2023
@pellared pellared added this to the untracked milestone Nov 8, 2024
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.

5 participants