- Update dashboard API client to support authority rule commands
- Add REST API and frontend page for authority rules
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
* sentinel-transport-netty-http will also retry when port specified has been used
* LogBase support variable arguments
* Remove duplicated JVM properties overriding in SentinelConfig
* Add VersionUtil to get version from jar
- Update dashboard API client to support authority and parameter flow commands
- Add REST API controller for parameter flow rules in dashboard
- Add pages for configuring parameter flow rules
- Update dependencies: upgrade Spring Boot to 2.x and remove unused dependencies
- Other refinements
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add callback registry for statistic slot for extensions.
- Add a new module `sentinel-parameter-flow-control` under `sentinel-extension`.
- Add a `CacheMap` interface to provide abstraction for cache. We use ConcurrentLinkedHashMap as the default implementation (LRU strategy)..
- Add a `ParameterMetric` class as frequent parameter metrics for a specific resource. The metric map is located in `ParamFlowSlot` rather than `ClusterNode`.
- Implement `ParameterLeapArray` as statistic data structure for frequent parameters in a period of time window.
- Add `ParamFlowSlot` as the checker slot; Add `ParamFlowChecker` to do rule checking; Add `ParamFlowRuleManager` to do rule managing.
- The statistic metrics for frequent parameters is enabled only if the related resource has configured parameter flow rule; Parameter metrics for removed rules will be cleared automatically.
- Leverage extensible `SlotChainBuilder` to provide a `HotParamSlotChainBuilder`.
- Add command handlers for hot param rules.
- Add test cases and demo.
- Add RequestOriginParser interface to extract request origin from the HTTP request
- Some code refinement
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- When amount of context exceeds the threshold, the `NullContext` will be set to current thread local. Thus, when checking context in `CtSph#entry`, once `NullContext` detected, the entry will not do rule checking on the slot chain.
- Cache the default context during initialization. Then when amount of context exceeds the threshold, entries under default context can do rule checking under default context.
- Enhance the error message
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add several `asyncEntry` method in `Sph` interface and `SphU` class.
- Add a new `AsyncEntry` class for asynchronous entry representation. Some refactor for `CtEntry`.
- Refactored `CtSph` and implement `asyncEntryInternal` for asynchronous entry.
- Add `runOnContext` and `replaceContext` method in `ContextUtil` for context switching.
- Support extensible `SlotChainBuilder` using SPI mechanism
- Add a `SlotChainProvider` to load slot chain builder and create new slot chains
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Abstract a universal `MetricsRepository` interface so that users can implement their own metrics persistence.
- Reuse original in-memory implementation (`InMemoryMetricsRepository`) as the default repository.
Signed-off-by: Eric Zhao <sczyh16@gmail.com>