diff --git a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/RemoteConnectorExecutor.java b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/RemoteConnectorExecutor.java index 28b7617103..a126153ba5 100644 --- a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/RemoteConnectorExecutor.java +++ b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/RemoteConnectorExecutor.java @@ -196,17 +196,20 @@ default void preparePayloadAndInvoke( .getTransient(ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT); User user = User.parse(userStr); if (getRateLimiter() != null && !getRateLimiter().request()) { + getLogger().error("Request is throttled at model level."); throw new OpenSearchStatusException("Request is throttled at model level.", RestStatus.TOO_MANY_REQUESTS); } else if (user != null && getUserRateLimiterMap() != null && getUserRateLimiterMap().get(user.getName()) != null && !getUserRateLimiterMap().get(user.getName()).request()) { + getLogger().error("Request is throttled at user level."); throw new OpenSearchStatusException( "Request is throttled at user level. If you think there's an issue, please contact your cluster admin.", RestStatus.TOO_MANY_REQUESTS ); } else { if (getMlGuard() != null && !getMlGuard().validate(payload, MLGuard.Type.INPUT, parameters)) { + getLogger().error("guardrails triggered for user input"); throw new IllegalArgumentException("guardrails triggered for user input"); } if (getConnectorClientConfig().getMaxRetryTimes() != 0) {