Skip to content

Conversation

@khansaad
Copy link
Contributor

@khansaad khansaad commented Jul 29, 2025

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

  • Bug fix
  • New feature
  • Docs update
  • Breaking change (What changes might users need to make in their application due to this PR?)
  • Requires DB changes

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.

  • New Test X
  • Functional testsuite

Test Configuration

  • Kubernetes clusters tested on: Openshift

Checklist 🎯

  • Followed coding guidelines
  • Comments added
  • Dependent changes merged
  • Documentation updated
  • Tests added or updated

Additional information

Include any additional information such as links, test results, screenshots here

@khansaad khansaad added this to the Kruize 0.7_prod release milestone Jul 29, 2025
@khansaad khansaad self-assigned this Jul 29, 2025
@khansaad khansaad added the enhancement New feature or request label Jul 29, 2025
@khansaad khansaad moved this to In Progress in Monitoring Jul 29, 2025
@khansaad khansaad moved this from In Progress to Under Review in Monitoring Jul 30, 2025
continue;
}
// log and validate requestId
String requestId = object.getRequest_id();
Copy link
Member

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;
    }
}

Copy link
Contributor Author

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() {
Copy link
Member

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]

Copy link
Contributor Author

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() {
Copy link
Member

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]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dinogun
Copy link
Contributor

dinogun commented Aug 1, 2025

@khansaad Please fix the conflcits

@khansaad
Copy link
Contributor Author

khansaad commented Aug 1, 2025

@khansaad Please fix the conflcits

Done

Copy link
Member

@bharathappali bharathappali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Under Review

Development

Successfully merging this pull request may close these issues.

3 participants