-
Notifications
You must be signed in to change notification settings - Fork 126
RSDK-12500: Link request limit exceeded log to docs #5455
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
base: main
Are you sure you want to change the base?
Conversation
robot/web/request_counter.go
Outdated
| "go.viam.com/rdk/utils/ssync" | ||
| ) | ||
|
|
||
| const reqLimitExceededURL = "https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const reqLimitExceededURL = "https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded" | |
| const reqLimitExceededURL = "https://docs.viam.com/dev/tools/common-errors/#exceeded-request-limit-on-resource" |
That link's anchor seems off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a pr in the docs to shorten it with a custom id! Wanted to wait till the rdk's log is changed until I make it live
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah gotcha! Seems fine then.
robot/web/web_test.go
Outdated
| test.That(t, status.Convert(err).Code(), test.ShouldEqual, codes.ResourceExhausted) | ||
| test.That(t, err.Error(), test.ShouldEndWith, | ||
| fmt.Sprintf("exceeded request limit 1 on resource %v", keyPrefix)) | ||
| fmt.Sprintf("exceeded request limit 1 on resource %v, see https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded "+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] Can use the variable here, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was better practice to leave tests as a string? but can def change if you think its better to use a variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better practice to leave tests as a string?
As in, it's better practice to not use string-interpolation/formatting-directives in tests? I hadn't heard that before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will update, maybe hallucinated that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another option is to use test.ShouldBeError and assert that the error is a RequestLimitExceededError
Adding instructions on how to troubleshoot "request limit exceeded" err because lots of people ask for help w/ it
app/RDK logger:
before:
2025-11-12T15:59:14.028Z WARN rdk web/request_counter.go:146 Request limit exceeded for resource {"method":"/viam.robot.v1.RobotService/GetMachineStatus","resource":"viam.robot.v1.RobotService"}after
2025-11-11T22:24:20.813Z WARN rdk web/request_counter.go:147 Request limit exceeded for method /viam.component.camera.v1.CameraService/GetImages on resource cam.viam.component.camera.v1.CameraService. See https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded for troubleshooting stepsSDK/CLI:
before:
2025-11-12T15:56:23.797Z ERROR client gosdk/gosdk.go:50 rpc error: code = ResourceExhausted desc = exceeded request limit 1 on resource base-1.viam.component.base.v1.BaseServiceafter:
2025-11-12T15:48:37.111Z ERROR client gosdk/gosdk.go:50 rpc error: code = ResourceExhausted desc = exceeded request limit 1 on resource base-1.viam.component.base.v1.BaseService, see https://docs.viam.com/dev/tools/common-errors/#req-limit-exceeded for troubleshooting steps