-
Notifications
You must be signed in to change notification settings - Fork 113
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
RSDK-9876: Add counts for each {component, gRPC method} invocation. #4765
Conversation
// Only count component APIs, for now. | ||
var apiMethod string | ||
switch { | ||
case strings.HasPrefix(info.FullMethod, "/viam.component."): |
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.
is there a downside in adding services as well?
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.
Nope -- just didn't want to deal with double checking all of the kinds of method names to do string parsing on.
robot/web/web.go
Outdated
|
||
// UnaryInterceptor returns an incoming server interceptor that will pull method information and | ||
// optionally resource information to bump the request counters. | ||
func (mc *RequestCounter) UnaryInterceptor( |
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.
should we add a stream interceptor as well?
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 think it's worthwhile, but not necessarily a blocker for this.
A stream being opened is an interesting event for sure, but we might care more about the messages being sent within a stream. And I think most stream calls are for webrtc dialing, which isn't covered by the viam.components
prefix right now.
robot/web/web.go
Outdated
|
||
// UnaryInterceptor returns an incoming server interceptor that will pull method information and | ||
// optionally resource information to bump the request counters. | ||
func (mc *RequestCounter) UnaryInterceptor( |
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: mc -> rc
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.
Oops, thanks. Was originally calling this "MethodCounter" and waffled.
I think the request to add services + streaming are good ideas. But I don't think it blocks this PR. If you're feeling motivated, I'd gladly welcome additional contributors! |
No description provided.