diff --git a/.changesets/add-noop-mode-for-unsupported-systems.md b/.changesets/add-noop-mode-for-unsupported-systems.md new file mode 100644 index 00000000..edec520e --- /dev/null +++ b/.changesets/add-noop-mode-for-unsupported-systems.md @@ -0,0 +1,6 @@ +--- +bump: "patch" +type: "add" +--- + +Unsupported systems as Windows won't start the agent and other integration components to prevent them from failing and allowing apps to be run normally. diff --git a/src/appsignal/agent.py b/src/appsignal/agent.py index 1f29315d..3c4f22df 100644 --- a/src/appsignal/agent.py +++ b/src/appsignal/agent.py @@ -16,6 +16,15 @@ class Agent: def start(self, config: Config) -> None: config.set_private_environ() + + if self.architecture_and_platform() == ["any"]: + print( + "AppSignal agent is not available for this platform. ", + "The integration is now running in no-op mode therefore ", + "no data will be sent to AppSignal.", + ) + return + p = subprocess.Popen( [self.agent_path, "start", "--private"], stdout=subprocess.PIPE, diff --git a/src/appsignal/client.py b/src/appsignal/client.py index f01e6fc9..8f402724 100644 --- a/src/appsignal/client.py +++ b/src/appsignal/client.py @@ -41,6 +41,8 @@ def start(self) -> None: if self._config.is_active(): logger.info("Starting AppSignal") agent.start(self._config) + if not agent.active: + return start_opentelemetry(self._config) self._start_probes() else: diff --git a/src/scripts/build_hook.py b/src/scripts/build_hook.py index 5f05b883..bdd733f9 100644 --- a/src/scripts/build_hook.py +++ b/src/scripts/build_hook.py @@ -114,6 +114,12 @@ def initialize(self, _version: str, build_data: dict[str, Any]) -> None: rm(agent_path) + if triple == "any": + print("Skipping agent download for `any` triple") + with open(platform_path, "w") as platform: + platform.write(triple) + return + tempdir_path = os.path.join(self.root, "tmp", triple) os.makedirs(tempdir_path, exist_ok=True) diff --git a/src/scripts/platform.py b/src/scripts/platform.py index 4f2da1cf..c115105e 100644 --- a/src/scripts/platform.py +++ b/src/scripts/platform.py @@ -19,4 +19,5 @@ # https://peps.python.org/pep-0656/ "aarch64-linux-musl": "musllinux_1_1_aarch64", "x86_64-linux-musl": "musllinux_1_1_x86_64", + "any": "any", }