-
Notifications
You must be signed in to change notification settings - Fork 67
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
grpc client template with logging, metric and circuit-breaker #627
Conversation
initial gRPC implementation delegated everything directly to YARPC. key changes in this diff: - gRPC client template has logging, metric and circuit breaking - Proto file parsing for extracting methods and req/res types - implement SpecProvider interface for use in incremental build as well as template hydrate
although yarpc supports other protocols, the structs we have is designed for grpc support specifically so gRPC in the name is the right abstraction instead of YARPC.
7e49bdc
to
a9b6b6c
Compare
codegen/templates/grpc_client.tmpl
Outdated
RequestVolumeThreshold: requestVolumeThreshold, | ||
Timeout: timeoutVal, | ||
}) | ||
return circuitBreakerDisabled |
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.
shouldn't this be return true
?
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.
oh right.
} | ||
} | ||
|
||
func configureCicruitBreaker(deps *module.Dependencies, timeoutVal int) bool { |
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 we should create a common template the common parts of the HTTP, GRPC and Tchannel templates to avoid duplicate templates. There's some info here on nested templates: https://golang.org/pkg/text/template/
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 we should create a common template the common parts of the HTTP, GRPC and Tchannel templates to avoid duplicate templates. There's some info here on nested templates: https://golang.org/pkg/text/template/
Good point. Makes sense.
I'm working on adding a few more tests but in the meanwhile, wanted to get an early review going. Some more refactor is in the progress as well.