diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2020-09-15 17:56:52 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2020-09-17 20:10:03 +0300 |
commit | 769b6ffbc54a7d9faf0dd25f8e20434e5972e7ca (patch) | |
tree | c53ee84b57ae95d95fff38836d8f1f175001725f /internal/praefect/middleware | |
parent | 6206616d93ece66349075c83d553a0a9af3e9cad (diff) |
add intercepted option to mark a service handled by praefect
Adds an option for marking a gRPC service as handled by Praefect.
Services handled by Praefect do not need operation or scope
annotations as they are only used for proxying logic.
Diffstat (limited to 'internal/praefect/middleware')
-rw-r--r-- | internal/praefect/middleware/methodtype.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/praefect/middleware/methodtype.go b/internal/praefect/middleware/methodtype.go index 6143ff7ba..c8a980dc0 100644 --- a/internal/praefect/middleware/methodtype.go +++ b/internal/praefect/middleware/methodtype.go @@ -32,6 +32,10 @@ func MethodTypeStreamInterceptor(r *protoregistry.Registry) grpc.StreamServerInt } func observeMethodType(registry *protoregistry.Registry, fullMethod string) { + if registry.IsInterceptedMethod(fullMethod) { + return + } + mi, err := registry.LookupMethod(fullMethod) if err != nil { logrus.WithField("full_method_name", fullMethod).WithError(err).Warn("error when looking up method info") |