spring-cloud-alibaba icon indicating copy to clipboard operation
spring-cloud-alibaba copied to clipboard

2023.0.3.3 网关的流控和熔断页面无法正常显示(实际2023.0.1.0之后的版本都不工作)

Open bryanxtong opened this issue 8 months ago • 1 comments

Which Component Spring Cloud Alibaba 2023.0.3.3(Sentinel)

Describe the bug For Spring cloud alibaba 2023.0.3.3, the gateway flow control and circuitbreaker control rules cannot show properly on sentinel 1.8.8 dashboard, but for 2023.0.1 It is normal. Simplest demo I provide an example to easily reproduce the problem.

To Reproduce Steps to reproduce the behavior:

  1. start the gateway-circuitbreaker app
  2. start the app-service app;
  3. access to it via http://localhost:8086/api/user/1 and then see the pages in sentinel databoard 1.8.8

Expected behavior API gateway items on left side should appear and now It is showing like normal pages for flow control and circuitbreaker control , not for api gateway.

Screenshots

Additional context java 17, sentinel dashboard 1.8.8, spring cloud alibaba 2023.0.3.3

bryanxtong avatar Jun 17 '25 00:06 bryanxtong

Temp Solution as below

comment the code below in SentinelApplicationContextInitializer.java and move to SentinelAutoConfiguration.java if (properties.isEager()) { InitExecutor.doInit(); }

===> ` public class SentinelAutoConfiguration { @Autowired private SentinelProperties properties;

/**
 * InitExecutor.doInit() will invoke the SentinelConfig static block which will then evaluate the csp.sentinel.app.type=11
 * If applied in SentinelApplicationContextInitializer, the csp.sentinel.app.type is not set in SentinelSCGAutoConfiguration and
 * give value zero
 */
@PostConstruct
public void init() {
    // earlier initialize
    if (properties.isEager()) {
        InitExecutor.doInit();
    }
}

`

Please help provide a good solution if you have.

bryanxtong avatar Jun 17 '25 06:06 bryanxtong

这个不是可以通过配置进行修改么: spring.cloud.sentinel.eager=true

herodotus-ecosystem avatar Jun 17 '25 13:06 herodotus-ecosystem

这个不是可以通过配置进行修改么: spring.cloud.sentinel.eager=true

配置了,但是还有问题,调用获得csp.sentinel.app.type的时间点不同版本发生了变化

bryanxtong avatar Jun 17 '25 13:06 bryanxtong

This issue has been open 30 days with no activity. This will be closed in 7 days.

github-actions[bot] avatar Jul 17 '25 18:07 github-actions[bot]

This issue has been automatically marked as stale because it hasn't had any recent activity.If you think this should still be open, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for your interest and contribution to the Sping Cloud Alibaba Community.

github-actions[bot] avatar Jul 24 '25 18:07 github-actions[bot]