Skip to content

Fix announce of processes on Windows. #767

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

pvital
Copy link
Member

@pvital pvital commented Jul 24, 2025

This PR:

  1. Format the TheMachine and Discovery classes by adding type annotations to the fsm.py file and using ruff.
  2. Refactor the Discovery class by changing it to a DataClass, and move it out of the fsm.py file.
  3. Add support to announce Windows processes. The implementation gracefully handles platform differences, ensuring consistent process information on both Unix and Windows environments:
  • Created a new _get_cmdline() function to return the command line of the current monitored process independently of the running platform.
  • Created the _get_cmdline_windows() function to return the command line on Windows machines.
  • Created _get_cmdline_unix() that returns the command line in Unix machines. It decides how to collect the information by running either the _get_cmdline_linux_proc() or the _get_cmdline_unix_ps().
  • Refactored the _setup_socket_connection() function.

Signed-off-by: Paulo Vital paulo.vital@ibm.com

pvital added 3 commits July 24, 2025 13:22
Added type annotations to the fsm.py file and used ruff (vscode) to:
- Black-compatible code formatting.
- fix all auto-fixable violations, like unused imports.
- isort-compatible import sorting.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
And move it out of the fsm.py file.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
This commit adds cross-platform process announcement to Instana Host Agents.

The implementation gracefully handles platform differences, ensuring consistent process information on both Unix and Windows environments:

- Created a new `_get_cmdline()` function to return the command line of the current monitored process independently of the running platform.
- Created the `_get_cmdline_windows()` function to return the command line on Windows machines.
- Created `_get_cmdline_unix()` that returns the command line in Unix machines. It decides how to collect the information by running either the ` _get_cmdline_linux_proc()` or the `_get_cmdline_unix_ps()`.
- Refactored the `_setup_socket_connection()` function.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant