Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: drop github per user rate limit tracking#12286

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 4 commits intomainfromstevenmasley/github_rate_limit
Feb 23, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedFeb 23, 2024
edited
Loading

Rate limits for authenticated requests are per user. This would be an excessive number of prometheus labels, so we only track the unauthorized limit.

The rate limit labels without a user label make no sense.

Closes:#10853

Unauthenticated Rate Limit

We used to hit the unauthenticated rate limit as our ValidateToken always required an external auth request. With#11830, we no longer waste an external auth request if we know the token is invalid.

Additionally, if we have an invalid token (say it was revoked),#11598 prevents us from constantly making an external auth request with the same invalid token in the "listen" loop. So when requiring a re authentication, we only trigger 1 request.

There is still improvement to be made, as an invalid token can trigger multiple requests if the user hits the same endpoint multiple times. The caching of "invalid" is only in the scope of 1 request atm. We could either persist the cached "invalid" to the db, or delete the link when we get a 401 back?

Rate limits for authenticated requests are per user.This would be an excessive number of prometheus labels,so we only track the unauthorized limit.
@EmyrkEmyrk requested a review fromjohnstcnFebruary 23, 2024 15:28
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

I think this makes sense, and I'm down for dropping unnecessary prom metrics 👍

Just need to make CI happy.

@Emyrk
Copy link
MemberAuthor

Just need to make CI happy.

Forgot to fix the tests for the rate limits. On it 👍

@EmyrkEmyrk merged commit13359aa intomainFeb 23, 2024
@EmyrkEmyrk deleted the stevenmasley/github_rate_limit branchFebruary 23, 2024 17:17
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 23, 2024
# TYPE coderd_oauth2_external_requests_rate_limit_total gauge
coderd_oauth2_external_requests_rate_limit_total{name="primary-github",resource="core"} 5000
coderd_oauth2_external_requests_rate_limit_total{name="secondary-github",resource="core"} 5000
coderd_oauth2_external_requests_rate_limit_total{name="primary-github",resource="core-unauthorized"} 5000
Copy link
Member

Choose a reason for hiding this comment

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

Should this be 60 instead of 5000?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

It should be, but it's only used to generate docs. The values are ignored, but the labels are included.

https://coder.com/docs/v2/latest/admin/prometheus#prometheus-configuration

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

So it is fine

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@matifalimatifalimatifali left review comments

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

GitHub Rate Limit
3 participants
@Emyrk@johnstcn@matifali

[8]ページ先頭

©2009-2025 Movatter.jp