Skip to content

Fix: Add TCPMon usage with WSO2 Micro Integrator#2251

Open
imalkaperera13 wants to merge 1 commit into
wso2:mainfrom
imalkaperera13:fix/issue-1622-tcpmon-docs
Open

Fix: Add TCPMon usage with WSO2 Micro Integrator#2251
imalkaperera13 wants to merge 1 commit into
wso2:mainfrom
imalkaperera13:fix/issue-1622-tcpmon-docs

Conversation

@imalkaperera13
Copy link
Copy Markdown

Resolves #1622 by adding a section on how to specifically configure and use TCPMon with WSO2 Micro Integrator (monitoring both incoming and outgoing messages).

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 8, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack

📝 Walkthrough

Overview

This PR adds comprehensive documentation on how to use TCPMon with WSO2 Micro Integrator, addressing the gap in existing guidance where users lacked clear instructions for integrating TCPMon into their MI setups.

Changes

Added a new section "Using TCPMon with WSO2 Micro Integrator" to the TCPMon documentation that provides two practical scenarios:

  1. Monitoring incoming messages (Client → TCPMon → MI): Instructions for intercepting requests sent from client applications to MI services before they reach proxy services or APIs. Users configure TCPMon as a listener on an alternate port that forwards traffic to the actual MI service, allowing inspection of incoming payloads.

  2. Monitoring outgoing messages (MI → TCPMon → Backend): Instructions for inspecting the payload that MI sends to external backend services. Users configure TCPMon to listen on a local port targeting the backend service, then update the MI endpoint definition to route through TCPMon instead of directly to the backend, enabling visibility of the exact outgoing payload before forwarding.

Both scenarios include step-by-step configuration instructions for TCPMon settings and the required integration artifact modifications.

File modified: en/docs/observe-and-manage/classic-observability-tcp/message-monitoring-with-tcpmon.md (+26 lines)

Walkthrough

This PR adds a new documentation section to the TCPMon message monitoring guide for WSO2 Micro Integrator. The addition covers two practical use cases: (1) monitoring inbound traffic from clients to MI by positioning TCPMon between the client and MI service, and (2) monitoring outbound traffic from MI to backend services by redirecting the MI endpoint configuration to TCPMon. Each scenario includes step-by-step instructions for configuration and traffic capture.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It references the resolved issue but omits most required sections from the template such as goals, approach, user stories, release notes, and testing details. Complete the pull request description by adding missing template sections, particularly goals, approach, user stories, and release notes to provide full context for reviewers.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding documentation for TCPMon usage with WSO2 Micro Integrator.
Linked Issues check ✅ Passed The pull request successfully addresses issue #1622 by adding documentation explaining how to configure and use TCPMon with WSO2 Micro Integrator for monitoring both incoming and outgoing messages.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the objectives stated in issue #1622; the documentation addition is scoped to TCPMon usage with WSO2 MI only.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Copy link
Copy Markdown
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

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/classic-observability-tcp/message-monitoring-with-tcpmon.md (1)

59-82: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add an explicit HTTP-only reminder in the MI-specific section.

This section should restate that TCPMon monitoring here applies to HTTP traffic, so readers do not assume HTTPS interception is supported in these flows.

Suggested edit
 When developing integrations with WSO2 Micro Integrator (MI), you can use TCPMon to monitor messages in two main ways: intercepting messages sent to the MI, and intercepting messages sent from the MI to an external backend.
+These examples assume HTTP traffic; TCPMon does not support viewing HTTPS-encrypted message content.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@en/docs/observe-and-manage/classic-observability-tcp/message-monitoring-with-tcpmon.md`
around lines 59 - 82, Add a clear HTTP-only reminder to the MI-specific TCPMon
monitoring sections: insert a concise sentence at the start of both "Monitoring
Messages Sent TO WSO2 MI (Client -> TCPMon -> MI)" and "Monitoring Messages Sent
FROM WSO2 MI (MI -> TCPMon -> Backend)" stating that these steps apply only to
HTTP traffic and that TCPMon does not intercept HTTPS/SSL traffic (so HTTPS
endpoints or secure backends will not be captured). Also mention that if the
integration uses an <endpoint> with HTTPS, users must disable TLS or use a
TLS‑aware proxy instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@en/docs/observe-and-manage/classic-observability-tcp/message-monitoring-with-tcpmon.md`:
- Line 80: The example hardcodes localhost in the Micro Integrator `<endpoint>`
target URL which breaks setups where MI and TCPMon are on different hosts;
update the `<endpoint>` example target URL to use a placeholder or the TCPMon
host/IP (e.g., http://<TCPMON_HOST>:8081/...) instead of
http://localhost:8081/... and add a short note clarifying that "localhost" is
valid only when MI and TCPMon run on the same host so readers must replace it
with the actual TCPMon host/IP when remote.

---

Outside diff comments:
In
`@en/docs/observe-and-manage/classic-observability-tcp/message-monitoring-with-tcpmon.md`:
- Around line 59-82: Add a clear HTTP-only reminder to the MI-specific TCPMon
monitoring sections: insert a concise sentence at the start of both "Monitoring
Messages Sent TO WSO2 MI (Client -> TCPMon -> MI)" and "Monitoring Messages Sent
FROM WSO2 MI (MI -> TCPMon -> Backend)" stating that these steps apply only to
HTTP traffic and that TCPMon does not intercept HTTPS/SSL traffic (so HTTPS
endpoints or secure backends will not be captured). Also mention that if the
integration uses an <endpoint> with HTTPS, users must disable TLS or use a
TLS‑aware proxy instead.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a034a881-d04f-424d-9f79-6d83a0f52d89

📥 Commits

Reviewing files that changed from the base of the PR and between 403cf6d and d14db04.

📒 Files selected for processing (1)
  • en/docs/observe-and-manage/classic-observability-tcp/message-monitoring-with-tcpmon.md

2. Open TCPMon and add a listener on an unused local port (e.g., `8081`).
3. Set the **Target Hostname** to the backend's hostname (`backend.com`).
4. Set the **Target Port** to the backend's port (`80`).
5. In your Micro Integrator integration artifact (e.g., the `<endpoint>` definition), change the target URL to point to the TCPMon listener (`http://localhost:8081/...`) instead of the actual backend URL.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid hardcoding localhost for MI endpoint redirection.

Line 80 can misroute traffic when MI and TCPMon run on different hosts. Use the TCPMon host/IP in the example and note that localhost applies only to same-host setups.

Suggested edit
-5. In your Micro Integrator integration artifact (e.g., the `<endpoint>` definition), change the target URL to point to the TCPMon listener (`http://localhost:8081/...`) instead of the actual backend URL.
+5. In your Micro Integrator integration artifact (e.g., the `<endpoint>` definition), change the target URL to point to the TCPMon listener (`http://<TCPMON_HOST>:8081/...`) instead of the actual backend URL. Use `localhost` only when MI and TCPMon run on the same machine.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
5. In your Micro Integrator integration artifact (e.g., the `<endpoint>` definition), change the target URL to point to the TCPMon listener (`http://localhost:8081/...`) instead of the actual backend URL.
5. In your Micro Integrator integration artifact (e.g., the `<endpoint>` definition), change the target URL to point to the TCPMon listener (`http://<TCPMON_HOST>:8081/...`) instead of the actual backend URL. Use `localhost` only when MI and TCPMon run on the same machine.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@en/docs/observe-and-manage/classic-observability-tcp/message-monitoring-with-tcpmon.md`
at line 80, The example hardcodes localhost in the Micro Integrator `<endpoint>`
target URL which breaks setups where MI and TCPMon are on different hosts;
update the `<endpoint>` example target URL to use a placeholder or the TCPMon
host/IP (e.g., http://<TCPMON_HOST>:8081/...) instead of
http://localhost:8081/... and add a short note clarifying that "localhost" is
valid only when MI and TCPMon run on the same host so readers must replace it
with the actual TCPMon host/IP when remote.


![TCPMon console option]({{base_path}}/assets/img/integrate/tcp/tcp-console-options.png)

## Using TCPMon with WSO2 Micro Integrator
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Using TCPMon with WSO2 Micro Integrator
## Using TCPMon with WSO2 Integrator: MI


When developing integrations with WSO2 Micro Integrator (MI), you can use TCPMon to monitor messages in two main ways: intercepting messages sent to the MI, and intercepting messages sent from the MI to an external backend.

### 1. Monitoring Messages Sent TO WSO2 MI (Client -> TCPMon -> MI)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
### 1. Monitoring Messages Sent TO WSO2 MI (Client -> TCPMon -> MI)
### Monitoring messages sent to WSO2 MI (Client -> TCPMon -> MI)

5. Update your client application to send its requests to the TCPMon listener port (`http://localhost:8291/...`) instead of directly to the MI.
6. TCPMon will capture the incoming request, display it, and forward it to the Micro Integrator.

### 2. Monitoring Messages Sent FROM WSO2 MI (MI -> TCPMon -> Backend)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
### 2. Monitoring Messages Sent FROM WSO2 MI (MI -> TCPMon -> Backend)
### Monitoring messages sent from WSO2 MI (MI -> TCPMon -> Backend)


## Using TCPMon with WSO2 Micro Integrator

When developing integrations with WSO2 Micro Integrator (MI), you can use TCPMon to monitor messages in two main ways: intercepting messages sent to the MI, and intercepting messages sent from the MI to an external backend.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
When developing integrations with WSO2 Micro Integrator (MI), you can use TCPMon to monitor messages in two main ways: intercepting messages sent to the MI, and intercepting messages sent from the MI to an external backend.
When developing integrations with WSO2 Integrator: MI, you can use TCPMon to monitor messages in two main ways: intercepting messages sent to the MI, and intercepting messages sent from the MI to an external backend.


### 1. Monitoring Messages Sent TO WSO2 MI (Client -> TCPMon -> MI)

If you want to inspect the requests sent from a client application before they reach a proxy service or API hosted on the Micro Integrator:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you want to inspect the requests sent from a client application before they reach a proxy service or API hosted on the Micro Integrator:
If you want to inspect the requests sent from a client application before they reach a proxy service or API hosted in MI:


### 2. Monitoring Messages Sent FROM WSO2 MI (MI -> TCPMon -> Backend)

To inspect the outgoing payload the Micro Integrator sends to an external backend service:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
To inspect the outgoing payload the Micro Integrator sends to an external backend service:
To inspect the outgoing payload that MI sends to an external backend service:

2. Open TCPMon and add a listener on an unused local port (e.g., `8081`).
3. Set the **Target Hostname** to the backend's hostname (`backend.com`).
4. Set the **Target Port** to the backend's port (`80`).
5. In your Micro Integrator integration artifact (e.g., the `<endpoint>` definition), change the target URL to point to the TCPMon listener (`http://localhost:8081/...`) instead of the actual backend URL.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
5. In your Micro Integrator integration artifact (e.g., the `<endpoint>` definition), change the target URL to point to the TCPMon listener (`http://localhost:8081/...`) instead of the actual backend URL.
5. In your MI integration artifact (e.g., the `<endpoint>` definition), change the target URL to point to the TCPMon listener (`http://localhost:8081/...`) instead of the actual backend URL.

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.

Documentation Incomplete: Using TCPMon with WSO2 MI Not Covered

3 participants