Skip to content

Conversation

@Dilhasha
Copy link

Purpose

Adds the following.

  • Add dashboard config changes related to new ICP to MI
  • Add the changes to send the delta heartbeat and full heartbeat

Goals

Support artifact listing in new ICP version

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email [email protected] to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to [email protected] and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

@Dilhasha Dilhasha requested a review from rosensilva as a code owner October 30, 2025 17:28
@Dilhasha Dilhasha marked this pull request as draft October 30, 2025 17:28
Comment on lines 73 to 81
public static void invokeHeartbeatExecutorService() {

// Check if new ICP is configured
if (ICPHeartBeatComponent.isICPConfigured()) {
log.info("New ICP configuration detected. Starting ICP heartbeat service.");
ICPHeartBeatComponent.invokeICPHeartbeatExecutorService();
return;
}
// Fall back to old dashboard heartbeat
String heartbeatApiUrl = configs.get(DASHBOARD_CONFIG_URL) + "/heartbeat";
Copy link
Contributor

Choose a reason for hiding this comment

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

Log Improvement Suggestion No: 1

Suggested change
public static void invokeHeartbeatExecutorService() {
// Check if new ICP is configured
if (ICPHeartBeatComponent.isICPConfigured()) {
log.info("New ICP configuration detected. Starting ICP heartbeat service.");
ICPHeartBeatComponent.invokeICPHeartbeatExecutorService();
return;
}
// Fall back to old dashboard heartbeat
String heartbeatApiUrl = configs.get(DASHBOARD_CONFIG_URL) + "/heartbeat";
// Check if new ICP is configured
if (ICPHeartBeatComponent.isICPConfigured()) {
log.info("New ICP configuration detected. Starting ICP heartbeat service.");
ICPHeartBeatComponent.invokeICPHeartbeatExecutorService();
return;
}
// Fall back to old dashboard heartbeat
if (log.isDebugEnabled()) {
log.debug("Starting dashboard heartbeat service with URL: " + heartbeatApiUrl);
}

Comment on lines 188 to +192
String stringResponse = getStringResponse(response);
JsonObject responseObject = null;
try {
responseObject = new JsonParser().parse(stringResponse).getAsJsonObject();
Gson gson = new Gson();
responseObject = gson.fromJson(stringResponse, JsonObject.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Log Improvement Suggestion No: 2

Suggested change
String stringResponse = getStringResponse(response);
JsonObject responseObject = null;
try {
responseObject = new JsonParser().parse(stringResponse).getAsJsonObject();
Gson gson = new Gson();
responseObject = gson.fromJson(stringResponse, JsonObject.class);
JsonObject responseObject = null;
try {
Gson gson = new Gson();
responseObject = gson.fromJson(stringResponse, JsonObject.class);
if (log.isDebugEnabled()) {
log.debug("Successfully parsed heartbeat response");
}

Comment on lines 84 to 136
* and full heartbeats when requested by the ICP.
*/
public static void invokeICPHeartbeatExecutorService() {
String icpUrl = getConfigValue(ICP_CONFIG_URL, null);
if (icpUrl == null) {
log.warn("ICP URL not configured. ICP heartbeat will not be started.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Log Improvement Suggestion No: 3

Suggested change
* and full heartbeats when requested by the ICP.
*/
public static void invokeICPHeartbeatExecutorService() {
String icpUrl = getConfigValue(ICP_CONFIG_URL, null);
if (icpUrl == null) {
log.warn("ICP URL not configured. ICP heartbeat will not be started.");
log.info("Starting ICP heartbeat service. Runtime: " + runtime + ", Interval: " + interval + "s");
ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
Runnable runnableTask = () -> {
try {
log.debug("Executing scheduled ICP heartbeat task");
sendDeltaHeartbeat(runtime, icpUrl);

Comment on lines +992 to +977
private static JsonArray collectLocalEntries(SynapseConfiguration synapseConfig) {
JsonArray localEntries = new JsonArray();
try {
@SuppressWarnings("unchecked")
Map<String, Object> entryMap = synapseConfig.getLocalRegistry();
for (Map.Entry<String, Object> entry : entryMap.entrySet()) {
JsonObject entryObj = new JsonObject();
entryObj.addProperty("name", entry.getKey());
entryObj.addProperty("type", "LocalEntry");
entryObj.addProperty("valueType", entry.getValue().getClass().getSimpleName());
localEntries.add(entryObj);
}
} catch (Exception e) {
log.error("Error collecting Local Entries", e);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Log Improvement Suggestion No: 4

Suggested change
private static JsonArray collectLocalEntries(SynapseConfiguration synapseConfig) {
JsonArray localEntries = new JsonArray();
try {
@SuppressWarnings("unchecked")
Map<String, Object> entryMap = synapseConfig.getLocalRegistry();
for (Map.Entry<String, Object> entry : entryMap.entrySet()) {
JsonObject entryObj = new JsonObject();
entryObj.addProperty("name", entry.getKey());
entryObj.addProperty("type", "LocalEntry");
entryObj.addProperty("valueType", entry.getValue().getClass().getSimpleName());
localEntries.add(entryObj);
}
} catch (Exception e) {
log.error("Error collecting Local Entries", e);
}
*/
private static JsonArray collectDataServices(SynapseConfiguration synapseConfig) {
JsonArray dataServices = new JsonArray();
try {
if (synapseConfig == null || synapseConfig.getAxisConfiguration() == null) {
log.debug("Synapse configuration or Axis configuration is not available for data services collection");
return dataServices;
}
log.info("Starting data services collection");
AxisConfiguration axisConfiguration = synapseConfig.getAxisConfiguration();
// Get available data service names using DBUtils
String[] dataServiceNames = org.wso2.micro.integrator.dataservices.core.DBUtils.getAvailableDS(axisConfiguration);
log.info("Found " + dataServiceNames.length + " data services to process");

Copy link
Contributor

@wso2-engineering wso2-engineering bot left a comment

Choose a reason for hiding this comment

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

AI Agent Log Improvement Checklist

⚠️ Warning: AI-Generated Review Comments

  • The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
  • Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.

✅ Before merging this pull request:

  • Review all AI-generated comments for accuracy and relevance.
  • Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
Comment Accepted (Y/N) Reason
#### Log Improvement Suggestion No: 1
#### Log Improvement Suggestion No: 2
#### Log Improvement Suggestion No: 3
#### Log Improvement Suggestion No: 4

@coderabbitai
Copy link

coderabbitai bot commented Nov 15, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant