alibaba / alibaba/Sentinel

能否将 dashboard 的 SentinelApiClient 抽象出来?

Open
#191 4 comments 0 reactions 0 assignees View on GitHub
area/dashboard help wanted kind/enhancement
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

能否将 dashboard 的 SentinelApiClient 抽象出来,这样便可以实现 dashboard 端动态规则的读取和推送 自定义,让使用者根据自己 DataSource 方案,去实现 SentinelApiClient,这样我们 dashboard 这边升级后使用者可以无缝升级到最新的 dashboard

### Describe what happened (or what feature you want)
目前的 dashboard 的 SentinelApiClient 是直接通过 http 从客户端读取、推送数据,无法灵活的自定义实现读取、推送,只能直接的 dashboard 上修改,这样会导致无法无缝升级到最新的 dashboard

### Describe what you expected to happen
我希望可以实现自定义dashboard端的读取、推送数据,并且可以无缝升级到最新的 dashboard

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

### Tell us your environment

### Anything else we need to know?
我这里已经实现了, 请见:[custom-dashboard](https://github.com/waveng/Sentinel/tree/custom-dashboard)。

这里我将 SentinelApiClient 抽象为 [sentinel-dashboard-datasource](https://github.com/waveng/Sentinel/tree/custom-dashboard/sentinel-dashboard-support/sentinel-dashboard-datasource)

并且实现了zookeeper的推送方案 [sentinel-dashboard-datasource-zookeeper](https://github.com/waveng/Sentinel/tree/custom-dashboard/sentinel-dashboard-support/sentinel-dashboard-datasource-zookeeper),项目有单元测试

要想使用 sentinel-dashboard-datasource-zookeeper 客户端需要[sentinel-datasource-zookeeper](https://github.com/waveng/Sentinel/tree/custom-dashboard/sentinel-extension/sentinel-datasource-zookeeper)包的支持,客户需要引用该包,并参照 sentinel-demo-zookeeper-datasource 进行配置;完整的使用实例见[test-dashboard-zk](https://github.com/waveng/Sentinel/tree/test-dashboard-zk)中的 [sentinel-demo-dubbo-zookeeper](https://github.com/waveng/Sentinel/tree/test-dashboard-zk/sentinel-demo/sentinel-demo-dubbo-zookeeper)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the custom-dashboard branch, especially sentinel-dashboard-support/sentinel-dashboard-datasource and sentinel-dashboard-datasource-zookeeper, then inspect their unit tests. Compare the existing dashboard SentinelApiClient with this implementation; done means dashboard data reading and pushing can be customized while allowing upgrades without dashboard edits, with the referenced tests still passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.