Open techzealot opened 5 years ago
Hi, thanks for your suggestion. It's a good idea for more flexible dashboard extension. We can have a try for it in later versions. And PRs are welcomed if you're going to implement this :)
我已经在本地的sentinel-dashboard扩展了接入Apollo配置中心,允许在dashboard和Apollo portal之间双向修改流控等规则,采用的是spring的@ConditionalOnProperty注解实现了你说的切换DataSource的功能,只需要在启动时加入-DruleDataSource = apollo 或者inMemory即可确定使用哪种实现
监控数据一般持久化到哪里?有Es的实现方式吗?
Issue Description
Type: feature request
Describe what happened (or what feature you want)
sentinel-dashboard的监控数据持久化扩展方式必须通过修改源码的替换
MetricsRepository
的实现// Sentinel-dashboard's monitoring data persistence extension must be implemented by modifying the source code to replace MetricsRepository
Describe what you expected to happen
可以实现类似 Spring Boot 条件bean,只在不存在用户自定义的 MetricsRepository 实现时采用 InMemoryMetricsRepository 实现。
好处有:
META-INF/spring.factories
中实现自动注入其他持久化实现)即可实现数据持久化的切换。// English translation:
Mechanism like Spring Boot conditional bean can be implemented, using the
InMemoryMetricsRepository
implementation only when there is no user-defined MetricsRepository implementation.The benefits are:
META-INF/spring.factories
) to achieve data persistence switching.