alibaba / alibaba/Sentinel

Dashboard Spring Boot Configuration more flexible support

Open
#2,053 3 comments 0 reactions 0 assignees View on GitHub
area/dashboard good first issue kind/enhancement
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

Type: *feature request*

### Describe what happened (or what feature you want)

Make dashboard more extensible.

### Describe what you expected to happen

Spring Boot Configuration more flexible

Use `@ConditionalOnMissingBean` not `@Component` directly, combine with `@Configuration` to create a bean.

For example, about `MachineDiscovery`.

We can write code like follow

```java
@Configuration
public class MachineDiscoveryConfiguration {

@Bean
@ConditionalOnMissingBean
public SimpleMachineDiscovery simpleMachineDiscovery() {
return new SimpleMachineDiscovery();
}

@Bean
@ConditionalOnMissingBean
public AppManagement appManagement(SimpleMachineDiscovery simpleMachineDiscovery) {
return new AppManagement(simpleMachineDiscovery);
}

}
```

And delete annotation `@Component` above class `SimpleMachineDiscovery` and `AppManagement`.

If someone want to custom their `AppManagement`, that will make it more easy.

Same principle can apply to `RuleRepository`, DynamicRuleProvider, DynamicRulePublisher too.

Contributor guide

Open the contributing guide

Research direction

Locate SimpleMachineDiscovery, AppManagement, RuleRepository, DynamicRuleProvider, and DynamicRulePublisher, then inspect how their Spring beans are currently declared. Compare that setup with the proposed @Configuration and @ConditionalOnMissingBean approach, and verify that applications can provide custom beans without conflicts.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.