* dashboard: update edit dialog for FlowRule and ParamFlowRule
- Add duration configuration support for ParamFlowRule
- Some other enhancements
* Code polish: move implementation of toRule() to AbstractRuleEntity
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add `getCookieValue` method in RequestItemParser interface and update GatewayParamParser
- Add cookie parsing logic for Spring Cloud Gateway and Zuul
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Separate converted parameter rules from ParamFlowManager. Now the converted rules will be kept in GatewayRuleManager directly.
- Add a GatewayFlowSlot to do separate flow checking for generated rules.
- Refactor rule converting mechanism: now gateway rules in normal mode (without parameter) will also be converted to a parameter flow rule. The index will be the last (the last position). In GatewayParamParser we put a constant value to the last position.
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add a ParameterMetricStorage specific for caching ParameterMetric (moved from ParamSlot)
- Add rule map building helper method in ParamFlowRuleUtil so that we can reuse it in other rule managers
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Add Sentinel MetricExtension, which provides extension to Sentinel internal statistics.
This extension provides callbacks when a request passes rule checking,
blocked by flow control, successfully end or exception occurred.
Accompanied by these events, response time and current thread number
will be recorded too.
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
- Now the adapter is based-on sentinel-api-gateway-adapter-common and supports both proxyId and customized APIs
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Refactor the semantics and logic for blockHandler and fallback
- Add `fallbackClass` support for fallback in global classes
- Add `defaultFallback` support
- Update test cases and demo
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- The `appType` can be retrieved from `csp.sentinel.app.type` field. It's useful to identify the service type (e.g. API gateway).
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
* support burst count, statistic interval per rule and throttling mode.
* Add fields in ParamFlowRule to support burst count, throttle, statistic interval per rule.
* Deprecate HotParamLeapArray and use token bucket algorithm directly.