func()

in plugins/kratosv2/instrument.go [49:126]


func (i *Instrument) Points() []*instrument.Point {
	return []*instrument.Point{
		// http transport
		{
			PackagePath: "transport/http",
			At:          instrument.NewStructEnhance("Server"),
		},
		{
			PackagePath: "transport/http",
			At:          instrument.NewStructEnhance("clientOptions"),
		},
		{
			PackagePath: "transport/http",
			At: instrument.NewStaticMethodEnhance("NewServer",
				instrument.WithArgsCount(1), instrument.WithArgType(0, "...ServerOption"),
				instrument.WithResultCount(1), instrument.WithResultType(0, "*Server")),
			Interceptor: "NewServerInterceptor",
		},
		{
			PackagePath: "transport/http",
			At: instrument.NewStaticMethodEnhance("Middleware",
				instrument.WithArgsCount(1),
				instrument.WithArgType(0, "...middleware.Middleware"),
				instrument.WithResultCount(1),
				instrument.WithResultType(0, "ServerOption")),
			Interceptor: "ServerMiddlewareInterceptor",
		},
		{
			PackagePath: "transport/http",
			At: instrument.NewStaticMethodEnhance("NewClient",
				instrument.WithArgsCount(2),
				instrument.WithArgType(0, "context.Context"), instrument.WithArgType(1, "...ClientOption"),
				instrument.WithResultCount(2),
				instrument.WithResultType(0, "*Client"), instrument.WithResultType(1, "error")),
			Interceptor: "NewClientInterceptor",
		},
		{
			PackagePath: "transport/http",
			At: instrument.NewStaticMethodEnhance("WithMiddleware",
				instrument.WithArgsCount(1),
				instrument.WithArgType(0, "...middleware.Middleware"),
				instrument.WithResultCount(1),
				instrument.WithResultType(0, "ClientOption")),
			Interceptor: "ClientMiddlewareInterceptor",
		},
		// grpc transport
		{
			PackagePath: "transport/grpc",
			At:          instrument.NewStructEnhance("Server"),
		},
		{
			PackagePath: "transport/grpc",
			At:          instrument.NewStructEnhance("clientOptions"),
		},
		{
			PackagePath: "transport/grpc",
			At: instrument.NewStaticMethodEnhance("NewServer",
				instrument.WithArgsCount(1), instrument.WithArgType(0, "...ServerOption"),
				instrument.WithResultCount(1), instrument.WithResultType(0, "*Server")),
			Interceptor: "NewServerInterceptor",
		},
		{
			PackagePath: "transport/grpc",
			At: instrument.NewStaticMethodEnhance("Middleware",
				instrument.WithArgsCount(1),
				instrument.WithArgType(0, "...middleware.Middleware"),
				instrument.WithResultCount(1),
				instrument.WithResultType(0, "ServerOption")),
			Interceptor: "MiddlewareInterceptor",
		},
		{
			PackagePath: "transport/grpc",
			At: instrument.NewStaticMethodEnhance("unaryClientInterceptor",
				instrument.WithArgType(0, "[]middleware.Middleware")),
			Interceptor: "UnaryClientInterceptor",
		},
	}
}