-
Notifications
You must be signed in to change notification settings - Fork 66
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
Set HTTP timeouts as downstream errors #1063
Conversation
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.
We might need similar checks around here as well?
if isCancelledError(r.Error) { |
Yeah so what should the behaviour be in this case:
|
Yeah I guess so
Yes and let the error wrapper handle 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.
LGTM 🎉
Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
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.
LGTM!
@ivanahuckova Would you like to take this for a spin to make sure it's resolving the issue you've experienced? |
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.
@ivanahuckova Thank you! I think we may have also solved this one with this change too BTW:
Let me know if it's still an issue if you can 🙏
If the error is returned from the handler, this is the classic problem of not having enough information on the other side since it's stripped over the wire. IIUC we'd need to add more to the plugin response (either directly to the protobuf) or some gRPC metadata that would indicate the appropriate status source. For a data response error though, maybe we should be setting the error source on the response over here if it's not already set IE if isCancelledError(r.Error) {
+ r.ErrorSource = ErrorSourceDownstream
hasCancelledError = true
}
if isHTTPTimeoutError(r.Error) {
+ r.ErrorSource = ErrorSourceDownstream
hasHTTPTimeoutError = true
} It's probably safer to only do this if not already set. But that should then use the appropriate status source (would need to confirm though). The more we touch here though in its current state, the more brittle it all feels 😬 Instrumenting the same thing across client and server is tricky. Anything to add or correct @marefr? |
I will try on friday
Yeah, I agree. One solution could be to fully focus on updating the SDK in all plugins and skip the API server metrics for now. This would help resolve all the issues. 🤔 I initially wanted us to use the API server metrics until all plugins had updated their SDKs, but I've been realizing that using it temporarily requires too much effort. Instead, it seems we should just concentrate on updating the SDK in the plugins. |
Isn't it what we do here grafana-plugin-sdk-go/backend/data_adapter.go Lines 69 to 90 in e1e82c0
Something that might be a potential problem is that we don't check here if it's not a plugin error grafana-plugin-sdk-go/backend/data_adapter.go Lines 69 to 81 in e1e82c0
We do that for |
Nevermind I think I see what you mean now. If there's a data response error and there's no |
I'll have a look at this and the new tasks added to #1050 |
Exactly!
Awesome - thank you 👍 |
PTAL #1066 |
I think it also solves also DeadlineExceeded error marking as downstream so marking that in #1050 as resolved. |
Fixes #1064