Skip to content

Conversation

@manojasomarathna
Copy link

@manojasomarathna manojasomarathna commented Dec 16, 2025

Summary

  • Enabled XML declaration in outgoing XML payloads by adding the Axis2 property WRITE_XML_DECLARATION=true to the Synapse configuration.
  • Updated Grafana-based observability documentation to reflect related configuration updates and formatting corrections.
  • Ensures compatibility with systems that require strict XML standards.

Problem Statement

Some external systems require an explicit XML declaration (for example, <?xml version="1.0" encoding="UTF-8"?>) in XML payloads.
By default, WSO2 Micro Integrator does not include this declaration, which can cause integration failures.

Solution

  • Configured the Synapse runtime to include XML declarations in outgoing messages using a supported Axis2 property.
  • Corrected and improved observability documentation to ensure accurate and consistent configuration examples.

Impact

  • Improves interoperability with strict XML consumers.
  • Reduces configuration errors by providing clearer and correctly formatted documentation.
  • No functional or behavioral changes for users who do not enable this configuration.

Documentation

The following documentation was updated:

  • setting-up-cloud-native-observability-on-a-vm.md
  • setting-up-cloud-native-observability-in-kubernetes.md

Testing

  • Documentation-only changes; no automated tests were required.
  • Configuration changes align with existing Micro Integrator runtime behavior.

Security Considerations

  • No credentials, secrets, or sensitive information are introduced.
  • Changes comply with WSO2 secure engineering guidelines.

Backward Compatibility

  • Backward compatible. The XML declaration is included only when explicitly enabled.

Related Issues / PRs

N/A

- Added <property name="WRITE_XML_DECLARATION" scope="axis2" value="true"/> 
  to Synapse configuration to include XML declaration in outgoing messages.
- Updated Step 1.4 of Grafana-based observability documentation to reflect 
  this change.
- This ensures compatibility with systems requiring XML declaration in payloads.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

Added VM doc Step 1.5 to enable XML declarations via Axis2 WRITE_XML_DECLARATION=true and include a Synapse handler snippet; normalized YAML/Helm indentation and mapping in the Kubernetes observability guide and compacted RBAC resources lists into inline arrays.

Changes

Cohort / File(s) Summary
VM documentation
en/docs/observe-and-manage/setting-up-cloud-native-observability-on-a-vm.md
Added Step 1.5: instructs setting Axis2 property WRITE_XML_DECLARATION = true to include XML declarations and added a Synapse handler configuration snippet including a CustomObservabilityHandler entry.
Kubernetes / Helm docs
en/docs/observe-and-manage/setting-up-cloud-native-observability-in-kubernetes.md
Fixed YAML/Helm indentation and nested mappings for wso2.config.synapseHandlers, wso2.deployment.envs (nesting JAVA_OPTS), and wso2.deployment.annotations; converted multi-line RBAC resources lists to single-line inline arrays in ClusterRole and Prometheus Agent ConfigMap.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify Step 1.5 numbering/placement and any cross-references in the VM doc.
  • Confirm Axis2 property syntax and code-block formatting.
  • Validate the Synapse handler snippet XML/YAML correctness and handler class name used.
  • Review YAML indentation and nested mapping correctness in the Kubernetes/Helm snippets.
  • Check RBAC resources arrays are syntactically correct and unchanged semantically.

Poem

🐰 I nibble lines of YAML bright,
I tuck an XML declaration tight.
Handlers hop into their place,
Configs align with tidy grace,
Observability hops into sight! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description provides a clear summary but deviates from the required template structure by using custom sections instead of the specified format. Restructure the description to follow the repository template: add explicit Purpose/Goals/Approach sections with linked issues, document test coverage and security checks (yes/no format), and populate Training/Certification/Marketing fields or mark as N/A with explanations.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main change: adding the WRITE_XML_DECLARATION property for XML payloads in MI, which aligns with the primary modification in the documentation files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 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.

@manojasomarathna
Copy link
Author

"Hi, could you please review this PR?"

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
en/docs/observe-and-manage/setting-up-cloud-native-observability-on-a-vm.md (1)

111-127: Fix markdown code fence error and reorder steps for logical document flow.

The new Step 1.5 is inserted between Step 1.4's explanatory text and its code block, disrupting the logical flow. Additionally, the XML code block lacks a closing fence before the TOML block begins, causing markdown rendering errors.

Complete Step 1.4 with its TOML handler configuration first, then add Step 1.5 after it. Ensure the XML code block in Step 1.5 is properly closed with a closing fence.

 To enable observability for the WSO2 Integrator: MI servers, add the following Synapse handler to the `deployment.toml` file (stored in the `<MI_HOME>/conf/` folder).
 
+```toml
+[[synapse_handlers]]
+name="CustomObservabilityHandler"
+class="org.wso2.micro.integrator.observability.metric.handler.MetricHandler"
+```
+
+### Step 1.5 - Enable XML Declaration in Payloads
+
+If you want your outgoing messages to include the XML declaration, add the following Axis2 property to your deployment.toml:
+
+```xml
+<property name="WRITE_XML_DECLARATION" scope="axis2" value="true"/>
+```
+
-### Step 1.5 - Enable XML Declaration in Payloads
-
-If you want your outgoing messages to include the XML declaration, add the following Axis2 property to your Synapse configuration:
-
-```xml
-<property name="WRITE_XML_DECLARATION" scope="axis2" value="true"/>
-
-
-```toml
-[[synapse_handlers]]
-name="CustomObservabilityHandler"
-class="org.wso2.micro.integrator.observability.metric.handler.MetricHandler"
-```
 After applying the above change, you can start the WSO2 Integrator: MI with the following JVM property:
🧹 Nitpick comments (1)
en/docs/observe-and-manage/setting-up-cloud-native-observability-on-a-vm.md (1)

113-116: Clarify the placement and specificity of the XML property configuration.

Line 113 refers to "Synapse configuration" without specifying the deployment.toml file, which is the standard location per Step 1.4. Additionally, clarify whether the XML property should be placed in the same [[synapse_handlers]] section as the CustomObservabilityHandler or in a separate Synapse configuration block.

Consider revising to:

If you want your outgoing messages to include the XML declaration, add the following Axis2 property to your Synapse handler configuration in the `deployment.toml` file:
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a831c2 and f9a2945.

📒 Files selected for processing (1)
  • en/docs/observe-and-manage/setting-up-cloud-native-observability-on-a-vm.md (1 hunks)

Corrected indentation and formatting in YAML configuration for MetricHandler.
Correct indentation for JAVA_OPTS in configuration.
Updated the YAML configuration for Prometheus Agent to improve formatting and clarity.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b253d2 and 06271c4.

📒 Files selected for processing (1)
  • en/docs/observe-and-manage/setting-up-cloud-native-observability-in-kubernetes.md (5 hunks)
🔇 Additional comments (3)
en/docs/observe-and-manage/setting-up-cloud-native-observability-in-kubernetes.md (3)

147-151: Straightforward environment variable configuration.

The JAVA_OPTS environment variable configuration is clear and enables the Prometheus API endpoint as intended.


160-167: Prometheus annotations are correctly formatted.

The annotations for Prometheus service discovery (path, port, and scrape flag) follow the standard Prometheus convention and should work as expected with the Prometheus Agent configuration.


204-204: RBAC resources array format is functionally equivalent.

Converting from multi-line resource entries to an inline array is a valid YAML formatting change and should not affect Kubernetes resource behavior.

Updated YAML configuration for WSO2 Integrator: MI to correct indentation and structure for synapseHandlers, deployment envs, and deployment annotations.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
en/docs/observe-and-manage/setting-up-cloud-native-observability-in-kubernetes.md (2)

132-138: MetricHandler class path uses incorrect package format (duplicate of prior review feedback).

Line 135 shows org.wso2.micro_integrator.observability.metric.handler.MetricHandler with an underscore in the package name. The correct path should use dots: org.wso2.micro.integrator.observability.metric.handler.MetricHandler. This exact issue was flagged in a previous review; please ensure the fix is applied.


458-458: Invalid regex syntax for named capture group (duplicate of prior review feedback).

The regex uses (<message>.*) which is not valid Oniguruma named capture group syntax. This was flagged in a previous review. The correct syntax is (?<message>.*). The current pattern will attempt to match the literal text <message> instead of creating a named capture group, which will not extract the message field correctly.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06271c4 and 0bf2a7b.

📒 Files selected for processing (1)
  • en/docs/observe-and-manage/setting-up-cloud-native-observability-in-kubernetes.md (5 hunks)

@manojasomarathna
Copy link
Author

Hi @SanojPunchihewa,
I’ve addressed all the CodeRabbit review comments (class path, regex, and YAML indentation fixes).
Could you please re-review and approve the PR when you have time?
Thank you!

@manojasomarathna
Copy link
Author

Hi, I’ve addressed the review comments by:

  • Fixing the MetricHandler class path
  • Correcting YAML indentation
  • Updating the log parser regex

Could you please re-review the latest changes?
Thank you!

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