-
Notifications
You must be signed in to change notification settings - Fork 62
Add support for requestId feature to log unique requests #1620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mvp_demo
Are you sure you want to change the base?
Conversation
Signed-off-by: Saad Khan <[email protected]>
| continue; | ||
| } | ||
| // log and validate requestId | ||
| String requestId = object.getRequest_id(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If requestId scope is only in if-block can we directly check the object.getRequest_id and assign to requestId inside the if-block for a better scoping of the variable?
something like this:
if (null != object.getRequest_id()) {
String requestId = object.getRequest_id();
LOGGER.info("request_id : {}", requestId);
errorMsg = validateRequestId(requestId);
if (!errorMsg.isEmpty()) {
errorReasons.add(errorMsg);
object.setErrors(getErrorMap(errorReasons));
failedUpdateResultsAPIObjects.add(object);
continue;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| public interface EvaluatePerformanceProfileConstraints { | ||
| } | ||
|
|
||
| public String getRequest_id() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we refactor -> rename the method name to getRequestId to keep it consistent across the code base.
[In Kruize Object we are maintaining it as getRequestId so just thought it would be better to use Camel Case rather than Snake Case]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Refactored now.
| this.experimentType = experimentType; | ||
| } | ||
|
|
||
| public String getRequest_id() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we refactor -> rename the method name to getRequestId to keep it consistent across the code base.
[In Kruize Object we are maintaining it as getRequestId so just thought it would be better to use Camel Case rather than Snake Case]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Saad Khan <[email protected]>
|
@khansaad Please fix the conflcits |
Done |
Signed-off-by: Saad Khan <[email protected]>
bharathappali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
ROS is planning to send a "request_id" param as part of the Input request to Kruize via createExperiment, updateResults and updateRecommendations APIs to uniquely identify each of the request and Kruize is expected to log this request on each call each of these APIs so that it gets reported in Kibana.
The "request_id" is being sent by the platform team, which is a 32 characters long hexadecimal/alphanumeric string and same will be forwarded by the ROS team to Kruize to log it in its system.
This parameter will be sent in the request body of createExperiment and updateResults API as part of the input JSON and as a request param in the updateRecommendations API.
Fixes (KRUIZE-825)
Type of change
How has this been tested?
Please describe the tests that were run to verify your changes and steps to reproduce. Please specify any test configuration required.
Test Configuration
Checklist 🎯
Additional information
Include any additional information such as links, test results, screenshots here