shim: Move ttrpc interceptors to plugins
This makes it so we don't need to import otelttrpc unless the shim is compiled with the `shim_tracing` build tag. This way otel is no longer compiled into the binary at all unless `shim_tracing` is set. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
@@ -74,7 +74,7 @@ func init() {
|
||||
}
|
||||
|
||||
var (
|
||||
_ = shim.TTRPCServerOptioner(&taskServiceWithFp{})
|
||||
_ = shim.TTRPCServerUnaryOptioner(&taskServiceWithFp{})
|
||||
)
|
||||
|
||||
type taskServiceWithFp struct {
|
||||
@@ -87,7 +87,7 @@ func (s *taskServiceWithFp) RegisterTTRPC(server *ttrpc.Server) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *taskServiceWithFp) UnaryInterceptor() ttrpc.UnaryServerInterceptor {
|
||||
func (s *taskServiceWithFp) UnaryServerInterceptor() ttrpc.UnaryServerInterceptor {
|
||||
return func(ctx context.Context, unmarshal ttrpc.Unmarshaler, info *ttrpc.UnaryServerInfo, method ttrpc.Method) (interface{}, error) {
|
||||
methodName := filepath.Base(info.FullMethod)
|
||||
if fp, ok := s.fps[methodName]; ok {
|
||||
|
||||
Reference in New Issue
Block a user