-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feature: websocket server framework, logs web session implementation #12053
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: main
Are you sure you want to change the base?
Conversation
This feature enables administrators to view management server logs directly in the UI through a dedicated API call. It leverages a Netty-based websocket server to stream logs in real time, offering an efficient way to monitor and debug server operations. Note that the plugin is disabled by default and must be enabled manually. Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12053 +/- ##
============================================
- Coverage 17.56% 17.52% -0.05%
- Complexity 15539 15546 +7
============================================
Files 5911 5940 +29
Lines 529359 531063 +1704
Branches 64655 64822 +167
============================================
+ Hits 92979 93043 +64
- Misses 425922 427554 +1632
- Partials 10458 10466 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Abhishek Kumar <[email protected]>
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.
Pull Request Overview
This PR introduces a comprehensive WebSocket server framework enabling both standalone (Netty-based) and embedded (Jetty-based) WebSocket server modes. The first implementation provides a Logs Web Session feature allowing ROOT administrators to securely stream and view management server logs in real-time via the UI.
Key changes:
- New WebSocket framework with flexible server configuration (standalone/embedded modes)
- Logs Web Session API and UI for real-time log streaming with filtering
- Database schema additions for session and management server configuration storage
Reviewed Changes
Copilot reviewed 88 out of 88 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| framework/websocket-server/* | Core WebSocket server framework with Netty implementation and router |
| plugins/logs-web-server/* | Logs web session plugin with API, streaming, and session management |
| ui/src/components/view/LogsConsole.vue | New UI component for displaying real-time logs with filtering |
| ui/src/utils/plugins.js | Enhanced job polling with log viewing capabilities |
| engine/schema/.../schema-42200to42300.sql | Database schema for logs sessions and management server details |
| client/src/main/java/.../ServerDaemon.java | Jetty server integration for embedded WebSocket support |
| server/src/main/java/.../ManagementServerImpl.java | Management server capabilities and configuration updates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ogs-web-server/src/main/java/org/apache/cloudstack/logsws/LogsWebSessionTokenCryptoUtil.java
Outdated
Show resolved
Hide resolved
| export const pollJobPlugin = { | ||
| install (app) { | ||
| function canViewLogs (logIds) { | ||
| console.log('canViewLogs', store.getters.features.logswebserverenabled, 'createLogsWebSession' in store.getters.apis, logIds, logIds && logIds.length > 0) |
Copilot
AI
Nov 13, 2025
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.
Console.log statement should be removed from production code. This debug logging can expose sensitive information and impact performance.
| if (result.logids) { | ||
| allLogIds.push(...result.logids) | ||
| } | ||
| console.log('pollJobPlugin', result.logids, allLogIds) |
Copilot
AI
Nov 13, 2025
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.
Console.log statement should be removed from production code. Debug logging should use proper logging mechanisms instead of console.log.
engine/schema/src/main/resources/META-INF/db/schema-42200to42300.sql
Outdated
Show resolved
Hide resolved
...t-server/src/main/java/org/apache/cloudstack/framework/websocket/server/WebSocketServer.java
Outdated
Show resolved
Hide resolved
...t-server/src/main/java/org/apache/cloudstack/framework/websocket/server/WebSocketServer.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Abhishek Kumar <[email protected]>
|
@blueorangutan package |
|
@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15818 |
Description
This PR introduces a WebSocket framework, enabling flexible configuration and management of WebSocket server and contexts.
The framework allows WebSocket services to run either as:
The first implementation built on this framework is the Logs Web Session, which allows ROOT administrators to securely stream and view logs in real-time via the UI, tied to specific API calls or actions.
Key Features
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?