* Add a ConsoleHandler to support logging into stdout and stderr.
* Add a `csp.sentinel.log.output.type` property to configure for output type of record logs (only a temporary design)
* Add millisecond to the format of CspFormatter
- Update the `GatewayParamParser` to support matching the request item.
- Update the internal logic of converting gateway rules to parameter flow rules. The unified mismatched parameters (`SentinelGatewayConstants.GATEWAY_NOT_MATCH_PARAM`) will be configured as an exception item with a large threshold (indicating always pass).
- Add a `GatewayRegexCache` to cache the compiled regex for performance.
- Constant rename: separate URL matching strategy from parameter matching strategy
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
* 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>