diff --git a/sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParameterMetric.java b/sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParameterMetric.java index a5ab902c27..577f353ce6 100644 --- a/sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParameterMetric.java +++ b/sentinel-extension/sentinel-parameter-flow-control/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/ParameterMetric.java @@ -141,6 +141,10 @@ public void decreaseThreadCount(Object... args) { if (arg == null) { continue; } + if (arg instanceof ParamFlowArgument) { + arg = ((ParamFlowArgument) arg).paramFlowKey(); + } + if (Collection.class.isAssignableFrom(arg.getClass())) { for (Object value : ((Collection)arg)) { @@ -201,6 +205,9 @@ public void addThreadCount(Object... args) { if (arg == null) { continue; } + if (arg instanceof ParamFlowArgument) { + arg = ((ParamFlowArgument) arg).paramFlowKey(); + } if (Collection.class.isAssignableFrom(arg.getClass())) { for (Object value : ((Collection)arg)) {