Repository: alibaba/Sentinel

Issue #1279: Spring Cloud Alibaba 2.2.0 web URLs cannot be extracted when using with Shiro
Created: 2020-02-11T08:59:30Z
后面不用看了，我降级到2.1.1.RELEASE版本就可以了，看来2.2.0版本有bug
dashboard项目已经部署，能启动，看到页面；
另一个项目，添加了
<dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
            <version>2.2.0.RELEASE</version>
        </dependency>
spring.cloud.sentinel.transport.dashboard=localhost:20000

只能监控到
/
/login
/logout

这三个url，其他的url点了好多次了，监控页面上也没有
只有登陆页面的url和登出页面的url可以监控到，其他url都监控不到；
当我把 @SentinelResource 注解写道每一个方法上，就可以监控到了。
但是我的项目确实是springboot项目，为啥不能自动呢？
项目中用了shiro，跟这个有关系么？

Duplicate issue #1343: It seems that my application cannot use Sentinel to help me configure the URL resources in the Controller.
Created: 2020-03-17T15:46:21Z
Issue Description
Type: bug report or feature request
Describe what happened (or what feature you want)
My code looks like this, I will define it in the interface first and then implement it.
@Api(value = "sms", description = "the sms API")
@RequestMapping(value = "/api/v1/message")
public interface SmsApi {

    @ApiOperation(value = "XXXXX", nickname = "smsAsyncSendPost", notes = "XXXXX", response = Integer.class, tags={ "sms", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = Integer.class) })
    @RequestMapping(value = "/sms/async-send",
        produces = { "application/json" }, 
        consumes = { "application/json" },
        method = RequestMethod.POST)
    ResponseEntity<Integer> smsAsyncSendPost(@ApiParam(value = "XXXX" ,required=true )  @Valid @RequestBody Sms body);
}


@RestController
public class SmsApiImpl implements SmsApi {

    @Autowired
    private SmsService smsService;

    @Override
    public ResponseEntity<Integer> smsAsyncSendPost(@Valid Sms sms) {
        try {
            this.smsService.smsAsyncSendPost(sms);
            return ResponseEntity.ok(1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(0);
    }
}

Describe what you expected to happen
I wrote the simplest request and found that Sentinel can do URL resources.
@RestController
public class SentinelController {

    @GetMapping("/hello")
    public String hello() {
        return "Hello Sentinel";
    }

}

How to reproduce it (as minimally and precisely as possible)





Tell us your environment
The version and configuration I use are as follows
<dependency>
       <groupId>com.alibaba.cloud</groupId>
       <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
       <version>2.2.0.RELEASE</version>
</dependency>
spring.cloud.sentinel.transport.port=8719
spring.cloud.sentinel.transport.dashboard=localhost:8080
management.endpoints.web.exposure.include=*
Anything else we need to know?
I want to get a reply as soon as possible, because it affects a lot of things

Closing comment (2020-03-18T16:23:42Z): Adding this in the application.properties:
spring.cloud.sentinel.filter.url-patterns=/**
This is due to the default pattern /* in older version of spring-cloud-starter-alibaba-sentinel.
It has been improved in the newest version, in which needn't add this config.
Related to #1279.