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

Statsbeat do not count failed request when throttle #911

Merged
merged 5 commits into from
Feb 15, 2022

Conversation

hectorhdzg
Copy link
Member

No description provided.

@@ -197,11 +205,8 @@ class Sender {
}
} else if (this._isRetriable(res.statusCode)) {
try {
if (this._statsbeat) {
if (this._statsbeat && res.statusCode != 429) {
Copy link

Choose a reason for hiding this comment

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

I believe 429 is also a retry scenario.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, we send Statsbeat metrics for throttle and retry, @heyams can you confirm?

Copy link

Choose a reason for hiding this comment

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

we do retry on 429. no retry on 439, which is throttling.

Copy link

Choose a reason for hiding this comment

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

can you only add 439 to throttling count in Statsbeat and then count 429 as failure? that's what we do in java.

Library/Sender.ts Outdated Show resolved Hide resolved
@heyams
Copy link

heyams commented Feb 10, 2022

@hectorhdzg here is breeze's definition of these 2 response codes:

 **429 - Too many requests**
  The client send too many telemetries to the endpoint within in the given time interval so it is throttled

* **439 - Too many requests and refresh cache**
  The client is throttled at one point so frequently that the endpoint would send it 439 status code saying that it is throttled and should not retry for a long time.
Then, the client would drop the current data from its buffers. (i.e. Monthly Quota Exceeded)

@hectorhdzg
Copy link
Member Author

Thanks @heyams, this PR will actually fix issue where we do not retry in Throttle as well, as other PR was using wrong code #910

  • 439 - Too many requests and refresh cache

    The client is throttled at one point so frequently that the endpoint would send it 439 status code saying that it is throttled and should not retry for a long time.
    Then, the client would drop the current data from its buffers.

Library/Sender.ts Outdated Show resolved Hide resolved
Copy link

@heyams heyams left a comment

Choose a reason for hiding this comment

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

👍

@heyams
Copy link

heyams commented Feb 11, 2022

@hectorhdzg let's chat tomorrow if we want to send two count to breeze.. daily quota exceeded vs. monthly quota exceeded.

@hectorhdzg hectorhdzg merged commit 811975d into develop Feb 15, 2022
@hectorhdzg hectorhdzg deleted the hectorhdzg/throttle branch April 8, 2022 22:56
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.

None yet

5 participants