-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
grpc: Add StaticMethod CallOption #6926
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #6926 +/- ##
==========================================
- Coverage 83.51% 82.27% -1.25%
==========================================
Files 287 296 +9
Lines 30920 31454 +534
==========================================
+ Hits 25824 25878 +54
- Misses 4020 4505 +485
+ Partials 1076 1071 -5
|
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.
Here's where to add the new version:
Line 961 in 03e76b3
) |
Added. |
Let me know if you want to still change the name of this Call Option. |
rpc_util.go
Outdated
// RegisteredMethod returns a CallOption which specifies that a call comes from | ||
// a registered method. This does nothing functionally, but serves as a signal | ||
// to other code. | ||
func RegisteredMethod() CallOption { |
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.
StaticMethod
, as discussed offline.
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.
Done.
rpc_util.go
Outdated
type StaticMethodCallOption struct{} | ||
|
||
func (StaticMethodCallOption) before(*callInfo) error { return nil } | ||
func (StaticMethodCallOption) after(*callInfo, *csAttempt) {} |
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.
Let's do:
type StaticMethodCallOption struct {
EmptyCallOption
}
(Then there is no need for before
/after
to be declared.)
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.
Done.
rpc_util.go
Outdated
// to a method that is static, which the method is known at compile time and | ||
// doesn't change at runtime. This can be used as a signal to stats plugins 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.
"that is static, which means ..."?
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.
Done.
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.
Please backport to the upcoming release branch ASAP.
This PR adds a call option that specifies whether a method is static. This is intended to be used by generated code and users to get a method attribute within OpenTelemetry while protecting the cardinality of OpenTelemetry timeseries.
RELEASE NOTES: