alibaba / alibaba/Sentinel

sentinel如何默认对所有接口都进行监控,而不需要单独每个controller下的方法写@SentinelResource?

Open
#3,071 4 comments 0 reactions 0 assignees View on GitHub
kind/question
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

目前是有加@SentinelResource的方法能在sentinel控制台看到,但是没有加的,都不显示,如何能让这些接口只要有被请求就全部显示在控制台呢?我的配置如下

Currently, there are methods for adding @ SentinelResource that can be seen on the Sentinel console, but those that are not added will not be displayed. How can we make these interfaces all appear on the console as long as they are requested? My configuration is as follows

```
spring:
cloud:
nacos:
discovery:
server-addr: http://192.168.1.121:8848 #Nacos地址
weight: 1
enabled: true
register-enabled: false
config:
server-addr: http://192.168.1.121:8848 #Nacos地址
file-extension: yaml #这里我们获取的yaml格式的配置
enabled: false
refresh-enabled: false
sentinel:
transport:
dashboard: 192.168.1.121:8858
port: 8719
heartbeat-interval-ms: 5000
namespace: mall
filter:
enabled: true
url-patterns: /**
eager:
enabled: true
datasource:
ds1:
nacos:
server-addr: 192.168.1.121:8848
dataId: mall-sentinel
groupId: DEFAULT_GROUP
data-type: json
rule-type: flow
```

Contributor guide

Open the contributing guide

Research direction

Review the Spring Cloud Sentinel filter configuration, especially filter.enabled and url-patterns: /**, and compare how annotated methods using @SentinelResource become dashboard resources. Trace the request-monitoring entry point and determine what would be required for every requested interface to appear without annotations; done means unannotated interfaces are visible in the Sentinel console while the shown transport and dashboard settings still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.